Infinite UI Demo

@uiForm

uiForm is a collection of components that make it easy to create forms.

.InputField

An input field is a basic form element that allows users to enter text.

Usage

@uiForm.InputField(uiForm.InputFieldSettings{
	InputType: uiForm.InputTypeText,
	InputName: "name",
	Label:     "Name",

	// OptionalFields
	TwoWayStatePath: "name",
})
Alpine.js Parent State (x-data)
<div x-data="{name: ''}"></div>

Live Example

Basic Input

Name

Value & IsReadOnly

Name

InputTypeNumberMin, Max & Step

Name

AffixLeftValue & AffixRightValue

Name
goinfinite.dev/
Name
.jpg

HintValue & HintDisplay

Name
This is a helpful hint displayed as a description below the input.
Name

.TextArea

A textarea is a form element that allows users to enter multiple lines of text.

Usage

@uiForm.TextArea(uiForm.TextAreaSettings{
	InputName: "description",
	Label:     "Description",

	// OptionalFields
	TwoWayStatePath: "description",
	IsRequired:      false,
	IsReadOnly:      false,
})
Alpine.js Parent State (x-data)
<div x-data="{description: ''}"></div>

Live Example

Description

Value & IsReadOnly

Description

.RadioInput

A radio input allows users to select one option from a set of options.

Usage

@uiForm.RadioInput(uiForm.RadioInputSettings{
	Label:           "Option 1",
	StateValue:      "option1",
	TwoWayStatePath: "selectedOption",
})
@uiForm.RadioInput(uiForm.RadioInputSettings{
	Label:           "Option 2",
	StateValue:      "option2",
	TwoWayStatePath: "selectedOption",
})
Alpine.js Parent State (x-data)
<div x-data="{selectedOption: 'option2'}"></div>

Live Example

.InlineRadioGroup

An inline radio group displays a set of radio options in a horizontal layout.

Usage

@uiForm.InlineRadioGroup(uiForm.InlineRadioGroupSettings{
	Label: "Select an option",
	InputSettings: []uiForm.RadioInputSettings{
		{
			Label:           "Option 1",
			StateValue:      "option1",
			TwoWayStatePath: "groupSelection",
		},
		{
			Label:           "Option 2",
			StateValue:      "option2",
			TwoWayStatePath: "groupSelection",
		},
	},

	// OptionalFields
	TwoWayStatePath: "groupSelection",
	InputName:       "group1",
})
Alpine.js Parent State (x-data)
<div x-data="{groupSelection: 'option2'}"></div>

Live Example

Select an option

.SelectInput

A select input allows users to select one option from a dropdown list.

Usage (w/FlatOptions)

@uiForm.SelectInput(uiForm.SelectInputSettings{
	InputName: "country",
	Label:     "Country",

	// OptionalFields
	FlatOptions: []string{"Argentina", "Brazil", "Chile"},
	TwoWayStatePath:          "country",
	ShouldIncludeBlankOption: true,
})
Alpine.js Parent State (x-data)
<div x-data="{country: ''}"></div>

Live Example

Country
  • --
  • Argentina
  • Brazil
  • Chile

Usage (w/LabelValueOptions)

@uiForm.SelectInput(uiForm.SelectInputSettings{
	InputName: "country",
	Label:     "Country",

	// OptionalFields
	LabelValueOptions: []uiForm.SelectLabelValueOption{
		{
			Label: "Argentina",
			Value: "AR",
		},
		{
			Label: "Brazil",
			Value: "BR",
		},
		{
			Label: "Chile",
			Value: "CL",
		},
	},
	TwoWayStatePath:          "country",
	ShouldIncludeBlankOption: true,
})
Alpine.js Parent State (x-data)
<div x-data="{country: ''}"></div>

Live Example

Country
  • --
  • Argentina
  • Brazil
  • Chile

Usage (w/LabelValueOptions and LabelHtml)

@uiForm.SelectInput(uiForm.SelectInputSettings{
	InputName: "country",
	Label:     "Country",

	// OptionalFields
	LabelValueOptions: []uiForm.SelectLabelValueOption{
		{
			Label:     "Argentina",
			LabelHtml: SelectInputDemoOption1(),
			Value:     "AR",
		},
		{
			Label:     "Brazil",
			LabelHtml: SelectInputDemoOption2(),
			Value:     "BR",
		},
		{
			Label:     "Chile",
			LabelHtml: SelectInputDemoOption3(),
			Value:     "CL",
		},
	},
	TwoWayStatePath:          "country",
	ShouldIncludeBlankOption: true,
})
Alpine.js Parent State (x-data)
<div x-data="{country: ''}"></div>

Live Example

Click the dropdown to see the HTML labels.

Country
  • --
  • 🇦🇷 Argentina

    Known for its dance and wine.

  • 🇧🇷 Brazil

    Known for its music and natural beauty.

  • 🇨🇱 Chile

    Known for its deserts and mysterious islands.

@uiDisplay

uiDisplay is a collection of components for displaying content.

.Accordion

An accordion is a vertically stacked list of items that can be expanded or collapsed to reveal content.

Usage

@uiDisplay.Accordion(uiDisplay.AccordionSettings{
	Items: []uiDisplay.AccordionItemSettings{
		{
			Title: "Section 1",
			Content: AccordionDemoSection1(),
			Icon: "ph-info",
		},
		{
			Title: "Section 2",
			Content: AccordionDemoSection2(),
		},
		{
			Title: "Section 3",
			Content: AccordionDemoSection3(),
		},
	},
})

Live Example

Section 1

This is the content for section 1. You can put any content here.

Section 2

This is the content for section 2. You can put any content here.

Section 3

This is the content for section 3. You can put any content here.

.Sidebar

A sidebar is a vertical navigation component that can contain various types of content.

Usage

@uiDisplay.Sidebar(uiDisplay.SidebarSettings{
	MiddleContent: SidebarDemoMiddle(),

	// OptionalFields
	HeaderContent:                 SidebarDemoHeader(),
	FooterContent:                 SidebarDemoFooter(),
	Width:                         "w-64",
	BackgroundColor:               "bg-neutral-50/5",
	IsVisibleTwoWayStatePath:      "isVisible",
	IsCollapsedTwoWayStatePath:    "isCollapsed",
	AttachmentMode:                uiDisplay.SidebarAttachmentModeFixed,
	AttachmentModeTwoWayStatePath: "attachmentMode",
	SideTwoWayStatePath:           "side",
})

Live Example

Alpine.js Parent State (x-data)
<div x-data="{
  isVisible: true,
  isCollapsed: false,
  attachmentMode: 'inline',
  side: 'left'
}"></div>

Controls

AttachmentMode

Side

.Tag

A tag is a small label that can be used to categorize or identify content.

Usage

@uiDisplay.Tag(uiDisplay.TagSettings{
	OuterLeftIcon: "ph-info",
	OuterLeftLabel: "Info",
	OuterRadius: uiDisplay.TagRadiusMd,
	InnerIcon: "ph-warning",
	InnerLabel: "Warning",
	Size: uiDisplay.TagSizeXs,
})

Live Example

TagSizeXs to TagSizeXl

Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning

TagRadiusNone to TagRadiusFull
(OuterRadius & InnerRadius)

Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning

OuterRingColor
(w/ OuterBackgroundColor "transparent")

Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning

OuterBackgroundColor
(w/o OuterRingColor)

Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning

InnerBackgroundColor

Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning
Info
Warning

Side Elements OnClickFunc

Add
Remove

@uiControl

uiControl is a collection of components for controlling content.

.Button

A button is a clickable element that can be used to trigger an action.

Usage

@uiControl.Button(uiControl.ButtonSettings{
	Label:       "Click me",
	IconLeft:    "ph-info",
	OnClickFunc: "alert('Button clicked!')",
})

Live Example

ButtonSizeXs to ButtonSizeXl

Button Shapes

IconLeft & IconRight

Button Colors

Button with Ring

Button with Tooltip

IsDisabledOneWayStatePath

Count:

.RangeSlider

A range slider allows users to select a value from a range by dragging a thumb along a track.

Usage

@uiControl.RangeSlider(uiControl.RangeSliderSettings{
	ThumbValueTwoWayStatePath: "sliderValue",
	TrackStartValue:           "0",
	TrackEndValue:             "100",
	TrackSteps:                "1",
})
Alpine.js Parent State (x-data)
<div x-data="{sliderValue: 50}"></div>

Live Example

Basic Slider

Value:

RangeSliderSizeXs to RangeSliderSizeXl

Thumb Shapes

Thumb Colors & Icons

ThumbValueBubble

Track Labels Positions

Track Colors & Icons

Dual Mode

Price Range: $ - $