The Changelog

What's new around here?

Succinct and informative updates about Flux.
December 12, 2024

Dark mode controls

Version ^1.0.30
A dark mode radio switcher
Flux has always supported dark mode in the sense that when your system appearance changes, Flux adapts.
However, there's a big gap between that kind of dark mode support, and providing controls to fully control dark mode for a site independently of system preferences.
Before we get into the details, just take a look at how simple it is now to create a dark mode switcher like the one shown above. Here is the exact code that was used for that switcher:
Copy to clipboard
<flux:radio.group variant="segmented" x-model="$flux.appearance">    <flux:radio value="light" icon="sun">Light</flux:radio>    <flux:radio value="dark" icon="moon">Dark</flux:radio>    <flux:radio value="system" icon="computer-desktop">System</flux:radio></flux:radio.group>
Here's another code snippet to make an even simpler toggle button:
Copy to clipboard
<flux:button x-on:click="$flux.dark = ! $flux.dark" ... />

New JavaScript APIs

As you might have noticed in the code snippets above, Flux now ships with a magic $flux object available to you inside Alpine expressions.
There are two dark-mode related affordances on this magic object: .dark and .appearance.
You can get/set the dark state of an app using the $flux.dark boolean property. You can also get/set the theme preference for an app using the $flux.appearance property (which will be one of three values: light, dark, and system).
Given these two simple properties, you should be able to accomplish any type of dark mode control widget you'd like. For example, a dark mode select, a dropdown menu, a toggle button, a toggle switch, radio groups, cards, or segmented radios. The sky's the limit.
If you need control from outside of Alpine, we've also shipped a global Flux object on the window called window.Flux.
Now, you can do something like this:
Copy to clipboard
let button = document.querySelector('...')button.addEventListener('click', () => {    Flux.dark = ! Flux.dark})

What's going on under the hood?

Out of the box, Flux will add/remove a .dark class to the <body> element of your page.
This means you can easily configure Tailwind to honor this class instead of the system preference using Tailwind configuration like so:
Copy to clipboard
module.exports = {    darkMode: 'selector',    ...}
Flux takes care of all the tricky bits like storing the user appearance preference in local storage to persist that choice between page loads.
We are also listening for system preference changes at run-time so that we can adapt the site without waiting for a new page load.
Doing these things yourself is not rocket science, but it certainly is more complicated than you want it to be. Enjoy.
November 24, 2024

Rich text editor

Version ^1.0.27
A rich text editor with a toolbar
Welp, we did it. As of today, Flux now ships with a rich text editor 🎉.
Just slap this one-liner anywhere in your app and you're off and editing:
Copy to clipboard
<flux:editor wire:model="content" />
We really sweat the details on this one and hope it shows.

Configurable toolbar

A rich text editor with a different toolbar configuration than before
Copy to clipboard
<flux:editor toolbar="heading | bold italic strike ~ link" />
To configure an editor's toolbar items, you can pass a custom arrangement into the toolbar prop as a string of item names mixed with separators (|) and spacers (~).
Because each of these items is a simple Blade component inside Flux, you can easily create your own Blade components and reference them by name inside the toolbar prop.

Custom toolbar items

An editor with a custom dropdown menu in the toolbar
If you want complete control over the toolbar, you can compose your own editor by assembling the Blade components yourself.
Here's an example of adding a custom dropdown menu to an editor's toolbar:
Copy to clipboard
<flux:editor>    <flux:editor.toolbar>        <flux:editor.heading />        <flux:editor.separator />        <flux:editor.bold />        ...        <flux:dropdown>            <flux:editor.button icon="ellipsis-horizontal" tooltip="More" />            <flux:menu>                <flux:menu.item wire:click="..." icon="arrow-top-right-on-square">Preview</flux:menu.item>                <flux:menu.item wire:click="..." icon="arrow-down-tray">Export</flux:menu.item>                <flux:menu.item wire:click="..." icon="share">Share</flux:menu.item>            </flux:menu>        </flux:dropdown>    </flux:editor.toolbar>    <flux:editor.content /></flux:editor>
As you can see, this is just Blade/HTML like any other component. You can style and assemble any other Flux components you like into the editor's toolbar.

Mouse optional

Showing there is only one tab stop at a time on the editor toolbar
The editor's toolbar uses a roving tabindex so that you don't have to tab through every toolbar item as you tab along the page. The toolbar acts as a single tab stop that you can navigate using the arrow keys.
You can navigate sub menus within the toolbar using only your keyboard as well.
In fact, you can operate everything about this editor, easily, without ever touching your mouse.

Markdown syntax

Typing markdown syntax into the editor to trigger formatting
Although this is a rich text editor, it supports Markdown syntax as a convenient way to control styling in your document as you edit.

Shortcuts

All the available toolbar operation icons in a row
All the standard keyboard shortcuts you're familiar with from other editors like Google Docs are available to use as well.
Here are a few examples:
  • Cmd+B Bold
  • Cmd+I Italic
  • Cmd+K Insert link

As a form field

An editor with a form field label and description
Copy to clipboard
<flux:editor label="Release notes" description="Explain what’s new in this release." />
We wanted this component to feel no different than a textarea field when using it inside a form.
This means tackling things like disabled and invalid states at both the field AND fieldset level, associating labels/descriptions with the editor, as well as focusing the editor when the field label is clicked.

Screen readers

A screenshot of the editor's accessibility tree in Chrome devtools
As you can see by the figure above, we worked hard to make sure the editor's accessibility tree was as descriptive and functional as possible.
Screen readers can easily discover and use all features inside the editor. This includes the tricky bits like toolbar sub-selects, tooltips, and insert-link popovers.

Dynamic JS bundle

Currently, every bit of Flux's JavaScript is contained inside a 21.5KB file.
Because of the enormity of a rich text editor and its dependancies, this component would add a whopping 85.3KB to the the Flux bundle size.
The problem is that many pages in an app don't use a rich-text editor at all and it doesn't make sense to penalize them with a bigger bundle.
Therefore, we included the editor's JavaScript as a separate bundle that gets loaded in parallel on an as-needed basis. The editor's JS will only be included at the exact moment it's needed to keep everything else in your app feeling light and snappy. This includes edge cases like lazy-loading an editor long after a page has already been loaded.

Localization

A screenshot of editor tooltip in spanish
All of the english copy used in this component is translatable by copying a predefined set of keys into your lang/?.json files.

Built on Tiptap & ProseMirror

Rather than wrapping a more batteries-included editor like Quill or TinyMCE, we opted to use Tiptap under the hood for the editor's core functionality.
Tiptap is a convenience wrapper around the extremely powerful ProseMirror project.
It's completely headless, meaning we have full control over all of the markup, visuals, and accessibility, without having to be responsible for the input/formatting interactions.
This means we can make the toolbar as customizable as everything else in Flux because we own all the HTML/CSS/JS for it.
Also, to help support and thank the ProseMirror project, we donated $1000 via their GitHub sponsors profile.

The future

For launch our goal was: a rock-solid editor that feels just as good to develop and use as any other component in Flux.
Now that we've accomplished that, we can start adding next-level features like image support and @mentions.
Stay tuned!
November 13, 2024

Multi-selects

Version ^1.0.23
Select dropdown with 2 items selected
We held off on releasing multi-selects at launch because we felt like there were too many decisions to get right, but here we are. In Flux version 1.0.23 and above, you are now able to pass the multiple prop and turn a single-select into a multi-select:
Copy to clipboard
<flux:select variant="listbox" multiple>    <flux:option>Photography</flux:option>    ...</flux:select>
Of course, data binding works as you'd expect, by passing the name of a Livewire property into wire:model, Livewire will keep the state of that property in sync with your selections:
Copy to clipboard
<flux:select wire:model="selected" variant="listbox" multiple>
Copy to clipboard
<?phpclass extends Livewire\Component{    public $selected = [];        ...}
We have big plans for the future of multi-select, like adding new variants for selecting pills, tags, avatars, etc., but for now, this is a good start.

Custom selected suffix

A select dropdown with the words: 2 industries selected
After your first selection, Flux shows the number of items selected, followed by the word "selected".
If you want to customize this to make it more contextual, you can do so using the selected-suffix prop:
Copy to clipboard
<flux:select selected-suffix="industries selected" variant="listbox" multiple>

Checkbox indicator

A select dropdown with checkboxes instead simple check marks for selected indicator icons
The default check mark icon is now configurable for multi-selects. If you want a checkbox visual indicator instead, you can use the new indicator prop:
Copy to clipboard
<flux:select indicator="checkbox" variant="listbox" multiple>
  • Support for multi-selects
  • Dispatch input events when select listbox clearable button is clicked so that wire:model.live picks up the change
Copyright © 2025 Wireable LLC ·Terms of Service
Built with by
Caleb Porzio and Hugo Sainte-Marie