Documentation
¶
Overview ¶
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Author: HyperparameterSI
Package shadcn provides opt-in, pure Go native components based on shadcn's Base UI Maia registry. Reference sources and attribution live in reference/. Build components inside ui.View; never retain an Element between builds.
Index ¶
- func Accordion(c *ui.Context, build func()) ui.Element
- func AccordionItem(c *ui.Context, title string, open *bool, build func()) ui.Element
- func Alert(c *ui.Context, title, description string, destructive ...bool) ui.Element
- func AlertDialog(c *ui.Context, open *bool, title, description string, confirm func()) ui.Element
- func AspectRatio(c *ui.Context, ratio float32) ui.Element
- func Attachment(c *ui.Context, name, description, state string, action func()) ui.Element
- func Avatar(c *ui.Context, name string, bitmap *ui.Bitmap) ui.Element
- func Badge(c *ui.Context, label string, variant ...Variant) ui.Element
- func Breadcrumb(c *ui.Context, items []string, selected *int) ui.Element
- func Bubble(c *ui.Context, text string, variant Variant) ui.Element
- func Button(c *ui.Context, label string, options ...ButtonOptions) ui.Element
- func ButtonGroup(c *ui.Context, build func()) ui.Element
- func Calendar(c *ui.Context, date *time.Time, options ...CalendarOptions) ui.Element
- func Card(c *ui.Context) ui.Element
- func CardContent(c *ui.Context) ui.Element
- func CardDescription(c *ui.Context, text string) ui.Element
- func CardFooter(c *ui.Context) ui.Element
- func CardHeader(c *ui.Context) ui.Element
- func CardTitle(c *ui.Context, title string) ui.Element
- func Carousel(c *ui.Context, index *int, count int, slide func(int)) ui.Element
- func ChartContainer(c *ui.Context, axes chart.Axes, build func(ui.Element)) ui.Element
- func ChartLegend(c *ui.Context, labels []string, colors []ui.Color) ui.Element
- func ChartTooltip(c *ui.Context, anchor ui.Element, open *bool, title string, build func()) ui.Element
- func Checkbox(c *ui.Context, on *bool, label string) ui.Element
- func CodeBlock(c *ui.Context, language, code string) ui.Element
- func Collapsible(c *ui.Context, title string, open *bool, build func()) ui.Element
- func Combobox(c *ui.Context, value *string, options []string) ui.Element
- func Command(c *ui.Context, query *string, items []CommandItem) ui.Element
- func Components() []string
- func ContextMenu(c *ui.Context, anchor ui.Element, items []MenuItem) ui.Element
- func DatePicker(c *ui.Context, date *time.Time) ui.Element
- func Dialog(c *ui.Context, open *bool, title string, build func()) ui.Element
- func Direction(c *ui.Context, d ui.Direction, build func()) ui.Element
- func Drawer(c *ui.Context, open *bool, title string, build func()) ui.Element
- func DropdownMenu(c *ui.Context, label string, items []MenuItem) ui.Element
- func Empty(c *ui.Context, title, description string, actions func()) ui.Element
- func Field(c *ui.Context, label string, build func()) ui.Element
- func Form(c *ui.Context, build func()) ui.Element
- func GroupItem(e ui.Element, index, count int, vertical ...bool) ui.Element
- func HoverCard(c *ui.Context, anchor ui.Element, build func()) ui.Element
- func Input(c *ui.Context, value *string, options ...InputOptions) ui.Element
- func InputGroup(c *ui.Context, build func()) ui.Element
- func InputGroupInput(c *ui.Context, value *string, options ...InputOptions) ui.Element
- func InputOTP(c *ui.Context, value *string, length int) ui.Element
- func Item(c *ui.Context, title, description string, actions func()) ui.Element
- func Kbd(c *ui.Context, text string) ui.Element
- func Label(c *ui.Context, text string) ui.Element
- func Marker(c *ui.Context, text string) ui.Element
- func Menubar(c *ui.Context, build func()) ui.Element
- func Message(c *ui.Context, author string, end bool, build func()) ui.Element
- func MessageScroller(c *ui.Context, state *ui.ScrollState, build func()) ui.Element
- func NativeSelect(c *ui.Context, value *string, options []string) ui.Element
- func NavigationMenu(c *ui.Context, build func()) ui.Element
- func Pagination(c *ui.Context, page *int, total int) ui.Element
- func Popover(c *ui.Context, anchor ui.Element, open *bool, build func()) ui.Element
- func Progress(c *ui.Context, value float64) ui.Element
- func Questionnaire(c *ui.Context, index *int, questions []Question, onComplete func()) ui.Element
- func Radio[T comparable](c *ui.Context, selected *T, value T, label string) ui.Element
- func RadioGroup(c *ui.Context, build func()) ui.Element
- func Resizable(c *ui.Context, size *float32, first, second func()) ui.Element
- func ScrollArea(c *ui.Context) ui.Element
- func Select(c *ui.Context, value *string, options []string) ui.Element
- func Separator(c *ui.Context, vertical ...bool) ui.Element
- func Sheet(c *ui.Context, open *bool, side Side, title string, build func()) ui.Element
- func Sidebar(c *ui.Context, selected *string, build func()) ui.Element
- func SidebarItem(c *ui.Context, id, label string) ui.Element
- func Skeleton(c *ui.Context) ui.Element
- func Slider(c *ui.Context, value *float64, lo, hi float64) ui.Element
- func Sonner(c *ui.Context)
- func Spinner(c *ui.Context) ui.Element
- func Switch(c *ui.Context, on *bool) ui.Element
- func Table(c *ui.Context, state *ui.ListState, columns []ui.TableColumn, count int, ...) ui.Element
- func Tabs(c *ui.Context, selected *int, labels ...string) ui.Element
- func Textarea(c *ui.Context, value *string, options ...InputOptions) ui.Element
- func Theme(dark bool) *ui.Theme
- func Toast(c *ui.Context, t ui.Toast) string
- func Toggle(c *ui.Context, on *bool, label string) ui.Element
- func ToggleGroup(c *ui.Context, build func()) ui.Element
- func Tooltip(c *ui.Context, anchor ui.Element, text string) ui.Element
- func Trace(c *ui.Context, title string, open *bool, build func()) ui.Element
- type ButtonOptions
- type CalendarOptions
- type CommandItem
- type DateRange
- type InputOptions
- type MenuItem
- type Question
- type Side
- type Size
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccordionItem ¶
func AlertDialog ¶
func Attachment ¶
Attachment is a file presentation. Loading and error states do not start I/O.
func Breadcrumb ¶
Breadcrumb reports an activated ancestor in selected; the last item is the current page and is deliberately not interactive.
func ChartContainer ¶
ChartContainer is Maia's themed composition surface for ui/chart plots. Importing other shadcn controls does not link chart geometry into an app.
func ChartTooltip ¶
func Collapsible ¶
func Components ¶
func Components() []string
Components returns the pinned Base UI Maia registry names in stable order. Presence in the catalog is not a claim of pixel-level parity; see README.md.
func ContextMenu ¶
ContextMenu draws its popup in Go, keeping Maia styling on every OS. Register it on an anchor that does not already own a HandleInput callback.
func DatePicker ¶
DatePicker composes Golet's native date editing and calendar popover.
func GroupItem ¶
GroupItem joins an element to its neighbors without overlapping borders. Apply this after styling each child of ButtonGroup, using zero-based indexes. vertical selects a column group; call Column on the container as well.
func InputGroup ¶
InputGroup shares one surface and focus outline across its input and addons. Use InputGroupInput inside it to avoid nested input borders.
func InputGroupInput ¶
InputGroupInput is the editable, borderless child of InputGroup.
func InputOTP ¶
InputOTP accepts ASCII digits, supports paste and preserves a single native editing/IME surface for keyboard navigation and accessibility.
func MessageScroller ¶
MessageScroller follows new content only while already at the bottom.
func NativeSelect ¶
NativeSelect uses the same Go selection semantics with Maia trigger geometry.
func Questionnaire ¶
func Table ¶
func Table(c *ui.Context, state *ui.ListState, columns []ui.TableColumn, count int, cell func(int, int)) ui.Element
Table draws Maia headers and cells over Golet's virtualized, selectable list. Column resizing and cell-block selection remain available in ui.Table.
func Theme ¶
Theme returns the neutral Maia palette. Keep a copy per window and pass it to Context.SetTheme; the component layer also respects caller theme overrides.
Types ¶
type ButtonOptions ¶
ButtonOptions are applied before input is handled.
type CalendarOptions ¶
type CalendarOptions struct {
Disabled func(time.Time) bool
FirstWeekday *time.Weekday
// Multiple enables independent date toggles. Range takes precedence if both
// bindings are provided. The date argument still tracks the last activation.
Multiple *[]time.Time
Range *DateRange
}
CalendarOptions controls unavailable dates and the first weekday. Locale and the default first weekday follow the Context's locale and region.
type CommandItem ¶
CommandItem is a command-palette action. ID must be stable and unique.
type DateRange ¶
DateRange is an inclusive calendar selection. A zero End means that only Start has been chosen and the next activation will complete the range.
type InputOptions ¶
InputOptions controls validation and availability without changing the binding.
type MenuItem ¶
type MenuItem struct {
Label, Shortcut string
Disabled, Separator bool
Checked *bool
Children []MenuItem
Action func()
}
MenuItem describes a native-drawn popup row, checkbox, or submenu.