Park UI
repository·main·Indexed 11 days ago
https://github.com/cschroeter/park-uiA multi-framework component library that combines Ark UI's headless component logic with Panda CSS styling. It provides accessible, high-quality UI components for React, Solid, and Vue, featuring a CLI for initialization and component management.
What's inside Park UI
Configure Scroll Area visibility and sizes
mainYou can customize the appearance of the Scroll Area using the following props:
- Visibility: Use the
scrollbarprop to control how the scrollbar is displayed (e.g., always visible, only on hover, or hidden). - Sizes: Use the
sizeprop to adjust the thickness of the scrollbar and the padding of the content area. - Horizontal Scrolling: The component automatically supports horizontal scrolling if the content overflows the width of the container.
- Visibility: Use the
Use Pagination.Items shortcut
mainThe
Pagination.Itemscomponent is a shortcut that automatically renders the correct sequence of page numbers and ellipsis based on thecountandpageSizeprops provided to the root.Using
<Pagination.Items />is functionally equivalent to mapping over thepagesarray provided by thePagination.Contextand rendering either aPagination.Itemor aPagination.Ellipsisdepending on the page type.// Shorthand version <Pagination.Items /> // Equivalent manual implementation <Pagination.Context> {({ pages }) => pages.map((page, index) => page.type === "page" ? ( <Pagination.Item key={index} {...page} /> ) : ( <Pagination.Ellipsis key={index} index={index} /> ), ) } </Pagination.Context>Configure Segment Group layout and orientation
mainYou can customize the visual layout of the
SegmentGroupusing the following props:size: Adjusts the size of the segmented group.fitted: When set totrue, makes the tabs fit the width of the container.orientation: Controls the direction of the group. Set toverticalto change from the default horizontal orientation.
Render file lists with FileUpload.Items and FileUpload.List
mainTo display the list of uploaded files, you can use shortcuts to avoid manual mapping.
FileUpload.Items: Renders the list of uploaded files within aFileUpload.ItemGroup. Use this if you want to customize how each file is rendered by accessing the context.FileUpload.List: A high-level shortcut that composesFileUpload.ItemGroupandFileUpload.Itemstogether for a quick implementation.
If you need to customize the rendering of each file, use
FileUpload.Contextto access theacceptedFilesarray.// Custom rendering using FileUpload.Context <FileUpload.ItemGroup> <FileUpload.Context> {({ acceptedFiles }) => acceptedFiles.map((file) => ( <FileUpload.Item key={file.name} file={file}> <FileUpload.ItemPreview /> <FileUpload.ItemName /> <FileUpload.ItemSizeText /> <FileUpload.ItemDeleteTrigger /> </FileUpload.Item> )) } </FileUpload.Context> </FileUpload.ItemGroup> // Concise rendering using FileUpload.Items <FileUpload.ItemGroup> <FileUpload.Items /> </FileUpload.ItemGroup> // Quickest rendering using FileUpload.List <FileUpload.List />How Park UI components are composed
mainPark UI components are built on top of Ark UI, a headless component library. This architecture ensures that components are highly composable and follow a predictable interface, making them easy to combine and customize across different JavaScript frameworks.Configure Drawer size and placement
mainYou can customize the appearance and behavior of the Drawer using the
sizeandplacementprops on theDrawer.Rootcomponent.size: Controls the dimensions of the drawer content.placement: Determines which screen edge the drawer slides out from (e.g., top, bottom, left, right).
Understand the Park UI color system and Radix Colors
mainPark UI replaces the standard Panda CSS
50–950scale with Radix Colors.Key characteristics:
- Shade Count: Each color includes 12 shades per mode (light and dark), totaling 24 shades per color.
- Structure: The system is built around one Accent color and one Gray color.
- Pairing Strategies:
- Neutral Pairings: Using a
neutralgray scale, which works well with any accent hue. - Natural Pairings: Choosing a gray scale that is saturated with the hue closest to your accent hue for a more harmonious, colorful vibe.
- Neutral Pairings: Using a
Use Switch.Control shortcuts
mainThe
Switch.Controlcomponent can be used in two ways. By default, it renders aSwitch.Thumbinside it. If you do not need to customize the thumb, you can use the self-closing<Switch.Control />shortcut for more concise code.// Explicit version <Switch.Control> <Switch.Thumb /> </Switch.Control> // Concise shortcut version <Switch.Control />Render multiple tags with TagsInput.Items
mainInstead of manually mapping over the tag values, you can use the
TagsInput.Itemsshortcut to automatically render all tag items based on the current value.If you need more control over how each item is rendered (e.g., custom text or specific item properties), you can use
TagsInput.Contextto access the currentvalueand map over it manually usingTagsInput.Item.// Concise way to render all items <TagsInput.Items /> // Custom way using Context <TagsInput.Context> {({ value }) => value.map((tag, index) => ( <TagsInput.Item key={index} index={index} value={tag}> <TagsInput.ItemPreview> <TagsInput.ItemText>{tag}</TagsInput.ItemText> <TagsInput.ItemDeleteTrigger /> </TagsInput.ItemPreview> <TagsInput.ItemInput /> </TagsInput.Item> )) } </TagsInput.Context>Configure InputAddon sizes and variants
mainYou can customize the appearance of the
InputAddonusing thesizeandvariantprops.size: Adjusts the dimensions of the addon to match the input field.variant: Changes the visual style (e.g., outlined, filled, etc.) of the addon.
Configure Code component sizes, variants, and colors
mainThe
Codecomponent can be customized using the following props:size: Adjusts the size of the code snippet.variant: Changes the visual appearance/style of the component.colorPalette: Updates the color scheme applied to the component.