components

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package components provides pre-built UI components for BubblyUI.

This package contains 30+ ready-to-use components organized by complexity:

  • Atoms: Basic building blocks (Button, Badge, Icon, Spinner, Text, Toggle)
  • Molecules: Composite components (Input, Select, Card, List, Menu, Tabs)
  • Organisms: Complex components (Table, Form, Modal)
  • Templates: Page layouts (PageLayout, AppLayout, PanelLayout, GridLayout)
  • Layout: Flexbox-inspired containers (Flex, HStack, VStack, Box, Center)

This package is an alias for github.com/newbpydev/bubblyui/pkg/components, providing a cleaner import path for users.

Example

import "github.com/newbpydev/bubblyui/components"

func template(ctx bubblyui.RenderContext) string {
    return components.VStack(components.StackProps{
        Children: []bubbly.Component{
            components.Text(components.TextProps{Content: "Hello!"}),
            components.Button(components.ButtonProps{Label: "Click Me"}),
        },
    }).View()
}

Index

Constants

View Source
const (
	AlignLeft   = components.AlignLeft
	AlignCenter = components.AlignCenter
	AlignRight  = components.AlignRight
)

Alignment constants.

View Source
const (
	AlignItemsStart   = components.AlignItemsStart
	AlignItemsCenter  = components.AlignItemsCenter
	AlignItemsEnd     = components.AlignItemsEnd
	AlignItemsStretch = components.AlignItemsStretch
)

AlignItems constants.

View Source
const (
	JustifyStart        = components.JustifyStart
	JustifyCenter       = components.JustifyCenter
	JustifyEnd          = components.JustifyEnd
	JustifySpaceBetween = components.JustifySpaceBetween
	JustifySpaceAround  = components.JustifySpaceAround
	JustifySpaceEvenly  = components.JustifySpaceEvenly
)

JustifyContent constants.

View Source
const (
	FlexRow    = components.FlexRow
	FlexColumn = components.FlexColumn
)

FlexDirection constants.

View Source
const (
	CheckboxChecked   = components.CheckboxChecked
	CheckboxUnchecked = components.CheckboxUnchecked
)

Checkbox characters.

View Source
const (
	DefaultHorizontalChar    = components.DefaultHorizontalChar
	DefaultHStackDividerChar = components.DefaultHStackDividerChar
	DefaultVStackDividerChar = components.DefaultVStackDividerChar
)

Divider characters.

View Source
const DefaultStackSpacing = components.DefaultStackSpacing

Default stack spacing.

Variables

View Source
var Accordion = components.Accordion

Accordion creates an accordion component.

View Source
var AppLayout = components.AppLayout

AppLayout creates a full application layout with header/sidebar/content.

Badge creates a label/tag component.

Box creates a container with padding and borders.

Button creates a clickable button component.

Card creates a card container component.

Center creates a centering container component.

Checkbox creates a checkbox component.

View Source
var Container = components.Container

Container creates a width-constrained container.

View Source
var DarkTheme = components.DarkTheme

DarkTheme is a dark color theme.

View Source
var DefaultTheme = components.DefaultTheme

DefaultTheme is the default component theme.

Divider creates a visual separator.

Flex creates a flexible container component.

View Source
var GridLayout = components.GridLayout

GridLayout creates a grid-based layout.

HStack creates a horizontal stack component.

View Source
var HighContrastTheme = components.HighContrastTheme

HighContrastTheme is a high-contrast accessibility theme.

Icon creates an icon component.

Input creates a text input component.

View Source
var LightTheme = components.LightTheme

LightTheme is a light color theme.

Menu creates a menu component.

Modal creates a modal dialog component.

View Source
var PageLayout = components.PageLayout

PageLayout creates a standard page layout.

View Source
var PanelLayout = components.PanelLayout

PanelLayout creates a panel-based layout.

Spacer creates flexible spacing.

Spinner creates a loading spinner component.

Tabs creates a tabbed interface component.

Text creates a text display component.

TextArea creates a multi-line text input component.

Toggle creates a toggle/switch component.

VStack creates a vertical stack component.

Functions

func Form

func Form[T any](props FormProps[T]) bubbly.Component

Form creates a form component with validation.

func List

func List[T any](props ListProps[T]) bubbly.Component

List creates a list component.

func Radio

func Radio[T any](props RadioProps[T]) bubbly.Component

Radio creates a radio button group component.

func Select

func Select[T any](props SelectProps[T]) bubbly.Component

Select creates a dropdown select component.

func Table

func Table[T any](props TableProps[T]) bubbly.Component

Table creates a data table component with sorting and pagination.

Types

type AccordionItem

type AccordionItem = components.AccordionItem

AccordionItem represents a single accordion item.

type AccordionProps

type AccordionProps = components.AccordionProps

AccordionProps configures an Accordion component.

type AlignItems

type AlignItems = components.AlignItems

AlignItems specifies cross-axis alignment in flex containers.

type Alignment

type Alignment = components.Alignment

Alignment specifies text/content alignment.

type AppLayoutProps

type AppLayoutProps = components.AppLayoutProps

AppLayoutProps configures an AppLayout component.

type BadgeProps

type BadgeProps = components.BadgeProps

BadgeProps configures a Badge component.

type BoxProps

type BoxProps = components.BoxProps

BoxProps configures a Box component.

type ButtonProps

type ButtonProps = components.ButtonProps

ButtonProps configures a Button component.

type CardProps

type CardProps = components.CardProps

CardProps configures a Card component.

type CenterProps

type CenterProps = components.CenterProps

CenterProps configures a Center component.

type CheckboxProps

type CheckboxProps = components.CheckboxProps

CheckboxProps configures a Checkbox component.

type ContainerProps

type ContainerProps = components.ContainerProps

ContainerProps configures a Container component.

type DividerProps

type DividerProps = components.DividerProps

DividerProps configures a Divider component.

type FlexDirection

type FlexDirection = components.FlexDirection

FlexDirection specifies the direction of flex items.

type FlexProps

type FlexProps = components.FlexProps

FlexProps configures a Flex component.

type FormProps

type FormProps[T any] = components.FormProps[T]

FormProps configures a Form component.

type GridLayoutProps

type GridLayoutProps = components.GridLayoutProps

GridLayoutProps configures a GridLayout component.

type IconProps

type IconProps = components.IconProps

IconProps configures an Icon component.

type InputProps

type InputProps = components.InputProps

InputProps configures an Input component.

type JustifyContent

type JustifyContent = components.JustifyContent

JustifyContent specifies main-axis alignment in flex containers.

type ListProps

type ListProps[T any] = components.ListProps[T]

ListProps configures a List component.

type MenuProps = components.MenuProps

MenuProps configures a Menu component.

type ModalProps

type ModalProps = components.ModalProps

ModalProps configures a Modal component.

type PageLayoutProps

type PageLayoutProps = components.PageLayoutProps

PageLayoutProps configures a PageLayout component.

type PanelLayoutProps

type PanelLayoutProps = components.PanelLayoutProps

PanelLayoutProps configures a PanelLayout component.

type RadioProps

type RadioProps[T any] = components.RadioProps[T]

RadioProps configures a Radio component.

type SelectProps

type SelectProps[T any] = components.SelectProps[T]

SelectProps configures a Select component.

type SpacerProps

type SpacerProps = components.SpacerProps

SpacerProps configures a Spacer component.

type SpinnerProps

type SpinnerProps = components.SpinnerProps

SpinnerProps configures a Spinner component.

type StackProps

type StackProps = components.StackProps

StackProps configures HStack and VStack components.

type TableProps

type TableProps[T any] = components.TableProps[T]

TableProps configures a Table component.

type TabsProps

type TabsProps = components.TabsProps

TabsProps configures a Tabs component.

type TextAreaProps

type TextAreaProps = components.TextAreaProps

TextAreaProps configures a TextArea component.

type TextProps

type TextProps = components.TextProps

TextProps configures a Text component.

type Theme

type Theme = components.Theme

Theme defines colors and styles for components.

type ToggleProps

type ToggleProps = components.ToggleProps

ToggleProps configures a Toggle component.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL