CinderUI.Components.Advanced (cinder_ui v0.1.0)

Copy Markdown View Source

Higher-level components that map to shadcn patterns with progressive enhancement.

Included:

These components intentionally favor no-JS defaults and expose hooks/classes so advanced interactions can be layered in using LiveView hooks.

View live Advanced examples and component docs.

Summary

Functions

Carousel shell.

Chart frame component for wrapping chart libraries with shadcn tokens.

Combobox scaffold using an input and option list.

Command palette layout.

Command/list item.

Sidebar panel region.

Sidebar footer container.

Sidebar group wrapper.

Sidebar header container.

Sidebar navigation item.

Phoenix-first sidebar shell for app layouts.

Sidebar sibling content region.

Profile/account menu pattern for sidebar footers.

Button that toggles the surrounding sidebar_layout/1 between expanded and collapsed.

Functions

carousel(assigns)

Carousel shell.

Render slides in :item slots and wire interactions with a LiveView hook or external script.

## Example

heex title="Carousel" align="full" <.carousel id="feature-carousel"> <:item><div class="rounded-md bg-muted p-8 text-sm">Slide one</div></:item> <:item><div class="rounded-md bg-muted/60 p-8 text-sm">Slide two</div></:item> </.carousel>

heex title="Autoplay with indicators" align="full" <.carousel id="marketing-carousel" autoplay={4000} indicators={true}> <:item><div class="rounded-md bg-muted p-8 text-sm">Overview</div></:item> <:item><div class="rounded-md bg-muted/60 p-8 text-sm">Analytics</div></:item> <:item><div class="rounded-md bg-muted/40 p-8 text-sm">Deployments</div></:item> </.carousel>

Screenshot

carousel/1 screenshot

View live examples and full component docs.

chart(assigns)

Chart frame component for wrapping chart libraries with shadcn tokens.

## Example

heex title="Chart shell" align="full" <.chart> <:title>Traffic</:title> <:description>Requests over the last 7 days.</:description> <div class="h-40 rounded-md bg-muted/60"></div> </.chart>

Screenshot

chart/1 screenshot

View live examples and full component docs.

combobox(assigns)

Combobox scaffold using an input and option list.

It is intentionally unopinionated on state and filtering logic.

## When to use it

Use combobox/1 when you want a lightweight client-side filter input that writes the selected label back into the visible text field.

Typing narrows the list and implicitly highlights the first visible match, so Enter can accept it without extra arrow-key navigation. Escape and clicking away restore the last committed value.

Prefer autocomplete/1 when the selected value needs to submit through a hidden input, when labels and values differ, or when the control participates in a larger form workflow.

## Example

heex title="Combobox" align="full" <.combobox id="plan" value="Pro"> <:option value="Free" label="Free" /> <:option value="Pro" label="Pro" /> </.combobox>

Screenshot

combobox/1 screenshot

View live examples and full component docs.

command(assigns)

Command palette layout.

This renders the shell of a command palette (input + list + items).

## Examples

heex title="Command palette" align="full" <.command placeholder="Search commands..."> <:group heading="General"> <.item value="profile">Profile</.item> <.item value="billing">Billing</.item> </:group> <:group heading="Workspace"> <.item value="settings">Settings</.item> </:group> </.command>

heex title="Project switcher" align="full" <.command placeholder="Jump to project..."> <:group heading="Projects"> <.item value="docs">Docs site</.item> <.item value="demo">Demo app</.item> </:group> <:group heading="Teams"> <.item value="platform">Platform team</.item> </:group> </.command>

Screenshot

command/1 screenshot

View live examples and full component docs.

item(assigns)

Command/list item.

## Example

heex title="Command item" align="full" <.command> <:group heading="General"> <.item value="profile">Profile</.item> </:group> </.command>

Screenshot

item/1 screenshot

View live examples and full component docs.

sidebar(assigns)

Sidebar panel region.

This is the left-hand sidebar itself. Use it inside sidebar_layout/1.

## Example

heex title="Sidebar panel" align="full" <div class="h-64 overflow-hidden rounded-xl border"> <.sidebar class="h-full"> <:header> <.sidebar_header> <span data-sidebar-label class="text-sm font-semibold">Workspace</span> </.sidebar_header> </:header> <.sidebar_group label="Navigation"> <.sidebar_item icon="home" current={true}>Home</.sidebar_item> <.sidebar_item icon="folder">Projects</.sidebar_item> </.sidebar_group> <:footer> <.sidebar_footer> <span class="text-sidebar-foreground/70 text-xs">Low-level panel helper</span> </.sidebar_footer> </:footer> </.sidebar> </div>

Screenshot

sidebar/1 screenshot

View live examples and full component docs.