Skip to content

0.5 - #49

Open
adoyle0 wants to merge 86 commits into
mainfrom
0.5
Open

0.5#49
adoyle0 wants to merge 86 commits into
mainfrom
0.5

Conversation

@adoyle0

@adoyle0 adoyle0 commented Jan 30, 2026

Copy link
Copy Markdown
Owner

Singlestage 0.5

This PR thread shall serve as a migration guide

Incomplete 0.5 docs are live at https://beta.singlestage.doordesk.net

  • Adds align and side props to DropdownMenuContent and PopoverContent for anchor positioning. The anchor is the trigger Button.
    Accepted values for align are "start" | "center" | "end", with "start" being the default.
    Accepted values for side are "top" | "right" | "bottom" | "left", with "bottom" being the default.

  • Adds open and modal props to DropdownMenu, ContextMenu, and Popover components.
    open is a reactive signal that controls open/close state of popovers, but is not coupled to the actual open state of the popover.
    modal controls whether a popover can be light dismissed (clicking off the popover/trigger, pressing esc, etc.) and can be used in conjunction with open to create a manually controlled popover. This effectively couples the open signal to the open state of the popover but this is not enforced so there may be edge cases where sync is lost.

  • dropdown-menu CSS class changed to dropdown-menu-content

  • Basic popover styling and positioning related CSS is now separate from menu styling CSS to better support custom popover/dropdown/context menu implementation

  • DropdownMenuItem now has a dismiss prop that toggles whether or not clicking the item closes the popover

  • dismiss and modal are Reactive and can take signals

  • Added animations for popovers for users who don't prefer reduced motion

  • Updated styling to mimic shadcn

  • Added submenus for dropdown and context menus

  • Added CheckboxItem and RadioItem components for use within popover menus

  • Added PopoverHeader, PopoverTitle, and PopoverDescription to Popover

  • Change all invalid and disabled props to Reactive to allow signals

Closes #44
Mitigates #48

  • Theme::Default is renamed to Theme::Neutral and the default theme is now Theme::Neutral
  • Alert now grows to the full width of its parent container
  • Added AlertAction component
  • as_button Link prop renamed to render_as and now takes a String. as_button=true is now render_as="button"
  • Links can now render as Badges with render_as="badge"
  • Added size prop to Avatar
  • Added AvatarBadge and AvatarGroupCount
  • Added "none" variant to Button
  • Added BreadcrumbEllipsis, BreadcrumbList, BreadcrumbPage
  • Breadcrumb changed name to BreadcrumbList and was replaced with a nav container component
  • Breadcrumb component is a bit more accessible with some aria roles and tags for screen readers
  • SelectItem renamed to SelectOption
  • SelectContent renamed to SelectOptGroup
  • Added CardAction
  • DialogTrigger is no longer a slot
  • <Dialog alert=true> is now <AlertDialog>
  • Added DialogCancel and DialogAction
  • Added AlertDialogCancel and AlertDialogAction
  • Added AlertDialogMedia
  • Added DialogContent, and AlertDialogContent which are now required, and dialog headers and footers go inside them now
  • AspectRatio ratio now takes a String
  • Progress max and value props now take f64
  • A bunch of components that share duplicate code are now built from component primitives for better DX
  • Added lighter weight testing/dev site for DX, later this can be used for playwright or something
  • Added orientation prop to Slider
  • Added size prop to Switch
  • Added orientation prop to Tabs
  • Added variant prop to TabsList
  • Tooltip has changed quite a bit to match shadcn:
<Tooltip side="top" align="center" value="Some text">
    <Button>"Submit"</Button>
</Tooltip>

would now be

<Tooltip>
    <TooltipTrigger>
        <Button>"Submit"</Button>
    </TooltipTrigger>
    <TooltipContent side="top" align="center">
        <p>"Some text"</p>
    </TooltipContent>
</Tooltip>
  • ThemeProvider should now come before user styles to ensure proper cascading:
...
<Stylesheet id="leptos" href="/pkg/my_app.css" />
<ThemeProvider>

    <Router>
        ...
    </Router>
</ThemeProvider>
...

to:

...
<ThemeProvider>
    <Stylesheet id="leptos" href="/pkg/my_app.css" />
    <Router>
        ...
    </Router>
</ThemeProvider>
...
  • Fields and various inputs now inherit signals for things like disabled and invalid from their parents. So an Input within a Field inherits from the Field, and in the case of a Checkbox within a Field within a CheckboxGroup, both the Field and Checkbox inherit from the CheckboxGroup
  • Field variant="button" was removed. Now any Field inside of a FieldLabel containing a checkbox, switch, or radio button renders as a choice card. Here is an example:
use leptos::prelude::*;
use singlestage::*;

#[component]
pub fn FieldChoiceCardExample() -> impl IntoView {
    view! {
        <FieldSet class="w-full max-w-xs">
            <FieldLegend variant="label">"Compute Environment"</FieldLegend>
            <FieldDescription>"Select the compute environment for your cluster."</FieldDescription>
            <RadioGroup value="kubernetes">
                <FieldLabel label_for="kubernetes-r2h">
                    <Field orientation="horizontal">
                        <FieldContent>
                            <FieldTitle>"Kubernetes"</FieldTitle>
                            <FieldDescription>
                                "Run GPU workloads on a K8s cluster."
                            </FieldDescription>
                        </FieldContent>
                        <Radio value="kubernetes" id="kubernetes-r2h" />
                    </Field>
                </FieldLabel>
                <FieldLabel label_for="vm-z4k">
                    <Field orientation="horizontal">
                        <FieldContent>
                            <FieldTitle>"Virtual Machine"</FieldTitle>
                            <FieldDescription>
                                "Access a cluster to run GPU workloads."
                            </FieldDescription>
                        </FieldContent>
                        <Radio value="vm" id="vm-z4k" />
                    </Field>
                </FieldLabel>
            </RadioGroup>
        </FieldSet>
    }
}
  • Add size and variant options for Links and Buttons used within SidebarMenuButtons
  • Link now uses leptos_router::components::A internally, which means it can now only be used within a Router context, which is probably fine more often than it's not
  • Link and Button now have aria_current, on Buttons it doesn't do anything outside of SidebarMenuButton currently
  • Links using render_as="button" while inside SidebarMenuButton override the sidebar styling with button styling. They stretch to the same width as other sidebar buttons. Button content is centered by default since it is the default style for Buttons, but it can be justified to the start or end with class="justify-start" class="justify-end" depending on which side the sidebar is on to make it more sidebar-like
  • Add as_child to Link and Button
  • vertical is removed from Separator, ButtonGroupSeparator, and ButtonGroup, and was replaced with orientation to match shadcn. so <Separator vertical=true /> is now <Separator orientation="vertical" />, etc.
  • Separators now auto center within their parent if a width is set, like class="w-48", etc.

adoyle0 and others added 7 commits January 29, 2026 19:54
… add external/manual popover control, add submenus, add `CheckboxItem` and `RadioItem`, add `PopoverHeader` components (#45)

* refactor: rework popovers

* add reactive `dismiss` prop to popovers and make `dismissable` reactive

* update docs and add inset prop to `DropdownMenuLabel` and `DropdownMenuItem`

* css

* more css

* add submenus for dropdown and context menus

* add more examples

* fix submenu positioning

* add `CheckboxItem` and `RadioItem`

* tweaks and docs

* open submenus on hover

* run clippy

* finish `Popover` stuff, add `PopoverHeader`, `PopoverTitle`, `PopoverDescription`, docs, and examples

* custom class support for popover header/children
… some optimizations (#77)

* change `Default` theme to `Neutral` and use neutral theme as default

* overhaul `Button` and add examples

* update button group and separator

* update accordion

* update `Alert` and add `AlertAction`

* update `Badge`, change `as_button` to `render_as`, links can render as badges

* rm old file

* update `Avatar` and add `size` prop to `Avatar`, add `AvatarBadge` and `AvatarGroupCount` and examples

* update breadcrumb, add `none` variant to `Button`

* update select components and add basic multi-select support

* update card, add `CardAction`

* update checkbox

* cleanup, consolidate and merge a bunch of components

* clean up checkbox

* more input/label tweaks

* update popovers

* more cleanup/try to separate layout and style more

* dialog stuff

* finish dialog/alert_dialog, examples and docs

* update `AspectRatio`

* update `Empty`

* update `Field`

* update input_group and textarea

* update item

* update kbd

* update label

* add `Label` examples

* update `Pagination`

* update `Progress`

* update leptosfmt.toml

* update `Radio` and make invalid and disabled states/labels consistent/respect parent `Field` values

* WIP: `Sidebar`, `Collapsible`, primitives, add trigger highlighting

* add `Sheet`, sidebar mobile rendering

* work on dialogs in dropdowns/triggers

* update deps

* add button active state

* add testing site

* start making primitives

* start making primitives

* more primitives

* separator wrappers

* fix hydration weirdness when spreading on primitives

* fix popover submenus opening in the wrong place

* fix some client routing effect weirdness

* make `CheckboxPrimitive` for `Checkbox` `Switch` and `Radio` and limit visibility for most contexts

* update `Skeleton` style

* add/update skeleton examples

* update slider

* clean up docs_macro and add multi-threading with rayon for syntax hightlighting - 3x speed increase

* more rayon more fast

* handle signals properly with no effects for checkboxes

* better signal handing/reactivity, lower latency

* better signal handing/reactivity, lower latency

* rm unused

* update `Switch` component/styling and examples

* update table

* update `Tabs` component and examples

* simplify some type descriptions for readability

* update `Toggle` component and examples

* update theme switcher a bit

* update `Tooltip` component and examples, some more reactivity tweaks

* set up modular base styles and hard code vega for now

* put that back

* hook up base switching and add accordion bases

* add `Alert` bases

* some dialog stuff

* add alert dialog variants

* add dialog variants

* rm redundant css, reduced motion gate, match shadcn api, fix width issues

* add avatar variants

* add badge variants

* add breadcrumb variants

* add button variants

* add button_group variants

* add card variants

* fix typo

* add checkbox variants

* better build.rs errors

* add dropdown variants

* add empty variants

* add label variants

* add field variants

* add input variants

* add input_group variants

* add item variants

* add kbd variants

* add pagination variants

* add popover variants

* add progress variants

* add radio variants

* add select variants

* add separator variants

* add sheet variants

* add sidebar variants

* add skeleton variants

* add slider variants

* add switch variants

* add table variants

* add tabs variants

* add textarea variants

* tweak sidebar shadows to match upstream

* add toggle variants

* add tooltip variants

* fix some style override issues

* css tweaks/fixes

* more css layering/tweaks/fixes

* tooltip tweaks

* fix tabs layering and underline

* more layer tweaks

* anchor positioning gets weird with spans

* fix field label cards

* `Fields` and inputs inherit `disabled` and `invalid` signals

* handle some warnings

* only sera should be uppercase

* more minor tweaks and fixes
@adoyle0 adoyle0 mentioned this pull request Jun 8, 2026
@blset

blset commented Jun 10, 2026

Copy link
Copy Markdown

Thanks a lot for the update !

@adoyle0

adoyle0 commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

FYI: dismissable is now modal and the logic is reversed to match radix/shadcn and general web terminology. In other words dismissable=false is now modal=true.

Sorry for any inconvenience but I got it wrong and now it's right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trigger a dropdown from outside

4 participants