Look-shadcn

Shadcn styling on SDK controls.

Luma Studio with the Retro Arcade theme showing Shadcn cards, forms, chat, and the color editor.

Use it

Shadcn · integration snippet
use gpui::{Context, Entity};
use xgpui_luma::controls::button::Button;
use xgpui_luma::infra::presenter::HasPresenter;
use xgpui_luma_look_shadcn as shadcn;

struct Example { save_requests: usize }

fn save_button(cx: &mut Context<Example>) -> Entity<Button> {
    shadcn::Button::new("save").primary().label("Save")
        .on_click(cx, |app, cx| {
            app.save_requests += 1;
            cx.notify();
        })
        .spawn(cx)
}

Inside an initialized view constructor. Store and render the returned entity.

Control support

Support describes the styling this Look supplies for the documented SDK controls. SDK behavior and events are shared across Looks.

Supported: a Look builder, theme, or template is available; the notes identify how to use it. Partial: styling is available only through another control. Not provided: no styling adapter is supplied. Styling not needed: use the SDK utility directly; its child controls or scrollbar may still need styling.

Shadcn support for SDK controls
ControlSupportNotes
AccordionSupportedAccordion builder.
AutocompleteSupportedAutocomplete builder.
ButtonSupportedButton builder. Primary, Secondary, Outline, Ghost, ContentOnly.
CheckboxSupportedCheckbox builder.
ComboBoxSupportedComboBox builder.
Context MenuSupportedContextMenu builder.
Control GroupSupportedcontrol_group_template(). Group templates and theme are available on ShadcnLook.
Dock SplitterSupporteddock_splitter_theme(). Pass the theme to the SDK builder.
Floating MenuSupportedfloating_menu_theme(). Pass the theme to the SDK menu.
FrameStyling not neededUse SDK Frame for layout and optional decoration; no Look is required. Optional Shadcn Frame and Frame::sidebar presets supply panel colors.
Icon ButtonSupportedUse Button with the SDK icon role; shares button styling.
Icon GroupSupportedIconGroup builder.
List BoxSupportedListBoxBuilder builder.
Overlay WindowSupportedoverlay_window(). ShadcnLook returns a themed SDK builder.
PagerSupportedPager builder.
Popover ButtonStyling not neededSupply the trigger and popup content; style those controls with the chosen Look.
Popup MenuSupportedPopupMenu builder.
Popup Scroll SurfaceStyling not neededPopup scrolling needs no Look styling; visible scrollbar chrome uses the supplied ScrollbarTemplate. ShadcnLook supplies scrollbar_template().
ProgressSupportedProgress builder.
Radio ButtonSupportedRadio builder.
Radio GroupSupportedRadioGroup builder.
Resizable PanelsSupportedresizable_panels(). ShadcnLook returns a themed SDK builder.
Scroll ContainerStyling not neededScrolling needs no Look styling; visible scrollbar chrome uses the supplied ScrollbarTemplate. ShadcnLook supplies scrollbar_template().
ScrollbarSupportedScrollbar builder.
Search SelectorSupportedSearchSelector builder.
Selection PanelSupportedSelectionPanel builder.
SelectorSupportedSelector builder.
Selector ListSupportedselector_items_panel_look(). Shared row styling used by selector-family controls; no standalone control.
SidebarSupportedSidebar builder.
Slide PanelSupportedslide_panel_background(). Also provides slide_panel_panels_look(); compose the SDK panel.
SliderSupportedSlider builder.
Split ButtonSupportedDedicated SDK SplitButton entity, template/theme factories, and independent primary disabling.
Split ViewSupportedsplit_view(). ShadcnLook returns a themed SDK builder.
StepperSupportedStepper builder.
SwitchSupportedSwitch builder.
TableSupportedTable builder.
TabsSupportedTabs builder.
Text AreaSupportedTextArea builder.
Text FieldSupportedTextField builder.
ToggleSupportedToggle builder.
ToolbarSupportedToolbar builder.
TooltipSupportedtooltip_theme(). Theme helper; Look builders attach it to supported controls.
Tree ViewSupportedTreeView builder.

Variants and customization options belong to each Look. Names in different Looks do not guarantee matching appearances. See the Look public API for exports.

Look selection

Builders use the application’s global ShadcnLook, or the built-in fallback. No .look(...) call is required.

Use .look(&custom_look) only to bind a particular instance, such as a fork or preview.

Customize

Shadcn’s Rust stylesheet constructor inherits the SDK baseline and supplies its color, metric, and elevation rules. Clone stylesheet::embedded_stylesheet() to customize the complete configuration. CSS catalogs continue to supply Shadcn theme tokens. For external TOML input, parse configuration with StylesheetConfig::parse and pass it to ShadcnLook::from_css_str_with_stylesheet. Common palette/geometry settings and look-owned CSS rules are distinct inputs. See shared stylesheet contract.

Start with builder variants. Use content presenters and template modifiers for local changes; use a template override for a different structure.

Public API · Button builder · Template examples

Load Shadcn themes

Use ShadcnLook::built_in() for the bundled fallback. Load custom palette tokens from CSS strings with ShadcnLook::from_css_str; the bundled CSS is also exported as xgpui_luma_look_shadcn::FALLBACK_CSS. The parser accepts tweakcn-style :root and .dark custom properties.

For a custom stylesheet, parse TOML with StylesheetConfig::parse, then pass it with the CSS string to ShadcnLook::from_css_str_with_stylesheet. Applications own file loading and any required path or input-size restrictions; the string parsers impose no size limits. The former from_css_path and from_css_path_with_stylesheet helpers have been removed.

Enable the look crate’s inspect feature for developer inspection tools. Luma Studio includes theme inspection examples; run it with just app-studio from the repository root, or just --set profile dev app-studio for a debug build.

Drag/drop

ListBox, Table, TreeView, Sidebar, Tabs and Accordion expose their SDK drag/drop configuration and named callbacks through Shadcn adapters. Render a persistent ListBox with ListBoxBuilder::from_control or ShadcnLook::render_listbox. See Drag and drop for the shared contract and coverage; ListBox, TreeView Table, Sidebar and Tabs and Accordion contain setup and examples.