You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A comprehensive reference guide to the available components in Wonop UI.
Accordion
The Accordion component is a collapsible section of content that allows users to toggle the visibility of content sections, providing an efficient way to organize and present information.
Usage
<Accordion title="Accordion example">
<p>This is the content of the accordion.It can be expanded or collapsed.</p>
</Accordion>
Props
Prop
Type
Description
title
String
The title of the accordion section
children
Children
The child elements to be rendered inside the accordion content
class
Classes
Additional CSS classes to apply to the accordion container
Styling Classes
Class Name
Description
accordion_container
For the main container of the accordion component
accordion_header
For the header section of the accordion
accordion_title
For the title text within the accordion header
accordion_content
For the content container of the accordion
Alert
The Alert component is used to display important messages to the user. It supports different types of alerts such as info, success, warning, and error.
Usage
<Alert alert_type={AlertType::Info}>
<p>This is an info alert</p>
</Alert>
<Alert alert_type={AlertType::Success}>
<p>This is a success alert</p>
</Alert>
<Alert alert_type={AlertType::Warning}>
<p>This is a warning alert</p>
</Alert>
<Alert alert_type={AlertType::Error}>
<p>This is an error alert</p>
</Alert>
Props
Prop
Type
Description
alert_type
AlertType
The type of alert to be displayed (Info, Success, Warning, Error)
icon
Option
An optional icon to be displayed in the alert
children
Children
Child elements to be rendered inside the alert
class
Classes
Additional CSS classes to apply to the alert container
Styling Classes
Class Name
Description
alert_base
Base styles for all alert types
alert_success
Styles specific to success alerts
alert_warning
Styles specific to warning alerts
alert_error
Styles specific to error alerts
alert_info
Styles specific to info alerts
Avatar
The Avatar component is used to display user profile images in different sizes. It supports small, medium, and large sizes, and allows for customization of the image URL and alt text.
The Badge component is used to display a small, inline element with a short label. It's often used to highlight status, counts, or categories in a compact and visually distinct way.
The type of badge to be displayed (Success, Warning, Error, Info, Default)
Styling Classes
Class Name
Description
badge_base
Base styling applied to all badges
badge_success
Styling for success-type badges
badge_warning
Styling for warning-type badges
badge_error
Styling for error-type badges
badge_info
Styling for info-type badges
badge_default
Styling for default-type badges
Breadcrumb
The Breadcrumb component is used to display a navigation trail for users. It helps users understand their location within the hierarchy of a website or application and provides easy navigation to parent pages.
The child elements to be rendered inside the breadcrumb component
separator_icon
Option
An optional custom separator icon between breadcrumb items
BreadcrumbItem
Prop
Type
Description
label
String
The text to be displayed for the breadcrumb item
href
Option
An optional URL for the breadcrumb item. If provided, the item will be rendered as a link
Styling Classes
Class Name
Description
breadcrumb_nav
For the main navigation container of the breadcrumb
breadcrumb_list
For the ordered list containing breadcrumb items
breadcrumb_item
For individual breadcrumb items
breadcrumb_separator
For the separator between breadcrumb items
Button
The Button component is a versatile and customizable button element that can be used in various parts of your application. It supports different variants, sizes, and can handle click events.
The callback to be executed when the button is clicked
variant
ButtonVariant
The variant of the button (Primary, Secondary, Success, Warning, Danger, Ghost, Default)
size
ButtonSize
The size of the button (Small, Medium, Large)
class
Classes
Additional CSS classes to be applied to the button
children
Children
The child elements to be rendered inside the button
disabled
bool
Whether the button is disabled or not
kind
Option
The type of the button, defaults to 'button' if not specified
Styling Classes
Class Name
Description
button_base
Base styles applied to all buttons
button_primary
Styles for primary buttons
button_secondary
Styles for secondary buttons
button_success
Styles for success buttons
button_warning
Styles for warning buttons
button_danger
Styles for danger buttons
button_ghost
Styles for ghost buttons
button_default
Styles for default buttons
button_small
Styles for small-sized buttons
button_medium
Styles for medium-sized buttons
button_large
Styles for large-sized buttons
Calendar
The Calendar component displays a monthly calendar view, allowing users to select a date. It provides a flexible and responsive interface for date selection tasks.
Usage
<Calendar
year={today.year()}
month={today.month()}
on_date_click={on_date_click.clone()}
selected_date={selected_date.map(|(y, m, d)| chrono::NaiveDate::from_ymd_opt(y, m, d).unwrap_or_default())}
/>
Props
Prop
Type
Description
year
i32
The year to display. Defaults to the current year if 0.
month
u32
The month to display (1-12). Defaults to the current month if 0.
on_date_click
Callback<(i32, u32, u32)>
A callback function that is called when a date is clicked, with the year, month, and day.
selected_date
Option
The currently selected date, if any.
Styling Classes
Class Name
Description
calendar_container
Main container of the calendar component
calendar_wrapper
Wrapper for the calendar content
calendar_header
Header section of the calendar
calendar_title
Title area containing month/year display
calendar_month_year
Display for current month and year
calendar_nav
Container for navigation buttons
calendar_grid
Grid layout for the calendar days
calendar_thead
Header of the calendar table
calendar_weekdays
Row containing weekday abbreviations
calendar_weekday
Individual weekday cell
calendar_tbody
Body of the calendar table
calendar_week
Row representing a week
calendar_day
Cell for each day in the calendar
calendar_day_button
Button for selecting a specific day
calendar_day_selected
Styling for the selected day
Card
The Card component is a versatile container that can hold various types of content. It is composed of several subcomponents to provide a flexible and customizable experience.
Usage
<Card>
<CardHeader>
<CardTitle>{"Card Title"}</CardTitle>
</CardHeader>
<CardContent>
{"This is the card content."}
</CardContent>
</Card>
Props
Card
Prop
Type
Description
children
Children
The child elements to be rendered inside the card.
class
Classes
Additional CSS classes to apply to the card.
onclick
Option<Callback>
Optional callback for click events on the card.
CardHeader
Prop
Type
Description
children
Children
The child elements to be rendered inside the card header.
class
Classes
Additional CSS classes to apply to the card header.
CardTitle
Prop
Type
Description
children
Children
The child elements to be rendered inside the card title.
CardContent
Prop
Type
Description
children
Children
The child elements to be rendered inside the card content.
Styling Classes
Class Name
Description
card_container
Styles for the main card container
card_header
Styles for the card header section
card_title
Styles for the card title
card_body
Styles for the card content area
Carousel
The Carousel component is a dynamic slideshow for cycling through a series of content. It provides an engaging way to display multiple items in a limited space, with automatic cycling and manual navigation options.
The child elements to be rendered inside the carousel.
interval
u32
The interval in milliseconds for cycling through the items.
next
Html
Optional custom next control button.
prev
Html
Optional custom previous control button.
CarouselItem
Prop
Type
Description
children
Children
The child elements to be rendered inside the carousel item.
Styling Classes
Class Name
Description
carousel_container
For the main container of the carousel
carousel_inner
For the inner container that holds all carousel items
carousel_item
For individual carousel items
carousel_item_active
For the currently active (visible) carousel item
carousel_controls
For the navigation controls container
carousel_control_prev
For the previous control button
carousel_control_next
For the next control button
Checkbox
The Checkbox component is a versatile input element that allows users to toggle between checked and unchecked states. It can be used in forms, settings, and anywhere a binary choice is needed.
The callback to be called when the checkbox is toggled.
disabled
bool
Whether the checkbox is disabled.
Styling Classes
Class Name
Description
checkbox_base
Base styles for the checkbox, including size, border, and background
checkbox_checked
Styles applied when the checkbox is checked, typically including a checkmark or fill color
checkbox_unchecked
Styles applied when the checkbox is unchecked
checkbox_disabled
Styles applied when the checkbox is disabled, usually reducing opacity
checkbox_label
Styles for the checkbox label, including font size, color, and spacing
CodeEditor
The CodeEditor component is a high-performance syntax highlighting editor that supports code editing, line numbers, inline diffs, annotations, and type hints. It uses syntect for syntax highlighting.
Font family (default: 'JetBrains Mono, monospace').
line_height
f32
Line height multiplier (default: 1.5).
class
Classes
Additional CSS classes.
style
String
Inline CSS styles.
on_change
Option<Callback>
Callback when code changes.
diffs
Vec
Line-based diffs to highlight changes.
annotations
Vec
Code annotations for errors, warnings, etc.
type_hints
Vec
Type information displays.
enable_multi_cursor
bool
Enable multiple cursors with Alt+Click.
enable_keymap
bool
Enable custom keymap support.
keymap
Option<HashMap<String, Callback>>
Custom keyboard shortcuts.
Styling Classes
Class Name
Description
editor-container
Container for the entire editor
line-numbers
Line numbers column
code-display
Main code display area
cursor-element
Editor cursor
diff-added
Added line highlight
diff-removed
Removed line highlight
diff-modified
Modified line highlight
annotation-error
Error annotation
annotation-warning
Warning annotation
annotation-info
Info annotation
Col
The Col component is a flexible container that arranges its children in a vertical layout. It can be customized with additional classes and an HTML tag of choice.
The HTML tag to use for the Col component (default: div).
Styling Classes
Class Name
Description
col_base
For the main container of the col component
Collapsible
The Collapsible component provides an expandable and collapsible container for content. It's useful for creating accordion-like structures or hiding content that doesn't need to be visible all the time.
Callback function called when the open state changes.
class
String
Additional CSS classes to apply to the collapsible container.
children
Children
Child components to be rendered inside the collapsible.
CollapsibleTrigger
Prop
Type
Description
as_child
bool
Whether to render the trigger as a child component.
children
Children
Child components to be rendered inside the trigger.
onclick
Callback
Callback function called when the trigger is clicked.
CollapsibleContent
Prop
Type
Description
class
String
Additional CSS classes to apply to the content container.
children
Children
Child components to be rendered inside the content area.
is_open
bool
Whether the content should be visible.
Styling Classes
Class Name
Description
collapsible_container
Styles for the main container of the collapsible component
collapsible_button
Styles for the trigger button that toggles the collapsible state
collapsible_content
Styles for the content container that appears when open
collapsible_header
Styles for the header section of the collapsible
collapsible_title
Styles for the title text within the collapsible header
collapsible_item
Styles for individual items within the collapsible content
ColorPicker
The ColorPicker component provides an interactive interface for users to select a color from a canvas. It allows for precise color selection and displays the currently selected color in multiple formats.
Usage
<ColorPicker
value={"#FF0000".to_string()}
width={200}
height={200}
onchange={Callback::from(|color:String| {// Handle color change})}
/>
Props
Prop
Type
Description
value
String
The initial color value of the picker (e.g., "#FF0000").
onchange
Callback
A callback function called when the color is changed.
width
u32
The width of the color picker canvas. Defaults to 200.
height
u32
The height of the color picker canvas. Defaults to 200.
Styling Classes
Class Name
Description
color_picker_container
Styles the main container of the color picker component
color_picker_canvas
Styles the canvas element where colors are displayed
color_picker_indicator
Styles the indicator that shows the currently selected color
color_picker_input_container
Styles the container for the color swatch and input field
color_picker_swatch
Styles the swatch displaying the currently selected color
color_picker_input
Styles the input field where the color value can be edited
Combobox
The Combobox component is a versatile dropdown component that combines the functionality of a text input and a select dropdown. It allows users to choose from a predefined list of options or enter custom values.
A list of options where each option is a tuple of (value, label).
on_select
Callback
The callback to be called when an option is selected.
disabled
bool
Whether the combobox is disabled. Default is false.
Styling Classes
Class Name
Description
combobox_button
Styles for the main button of the combobox
combobox_button_open
Additional styles applied when the combobox dropdown is open
combobox_button_disabled
Styles applied when the combobox is disabled
combobox_list
Styles for the dropdown list container
combobox_item
Styles for individual items in the dropdown list
combobox_item_selected
Styles applied to the currently selected item
combobox_heading
TODO
Command
The Command component is a versatile input component that combines search functionality with option selection. It provides an intuitive interface for users to quickly find and choose from a list of options, supporting both keyboard and mouse interactions.
The placeholder text to be displayed in the input field.
options
Vec<(T, String, String, Option)>
A list of options where each option is a tuple of (value, keywords, label, icon).
on_select
Callback
The callback to be called when an option is selected.
class
Classes
Additional CSS classes to apply to the command container.
Styling Classes
Class Name
Description
command_container
Styles the main container of the command component
command_input_wrapper
Styles the wrapper around the input and search icon
command_icon
Styles the search icon
command_input
Styles the input field
command_list
Styles the list of options
command_item
Styles individual items in the list
command_item_icon
Styles icons within list items
command_selected_item
Styles the currently selected item in the list
Container
The Container component is a versatile layout element that wraps content with optional padding, expanding, and size variations. It helps in creating responsive designs that adjust according to the screen size.
Usage
<Container
class={classes!("custom-class")}tag="section"
expanding={true}
padding_x={true}
padding_y={true}
variant={ContainerVariant::Large}
style={Some("background-color: lightgrey;".to_string())}
>
<p>{"This is a container with the large variant."}</p>
</Container>
Props
Prop
Type
Description
children
Children
The child elements to be rendered inside the container.
class
Classes
Additional classes to apply to the container.
tag
String
The HTML tag to use for the container. Default is 'div'.
expanding
bool
Whether the container should expand. Default is true.
padding_x
bool
Whether to apply horizontal padding. Default is true.
padding_y
bool
Whether to apply vertical padding. Default is true.
variant
ContainerVariant
The size variant of the container. Default is 'Responsive'.
style
Option
Optional inline styles for the container.
ContainerVariant
Variant
Description
Small
A small container
Narrow
A narrow container
Large
A large container
Responsive
A responsive container (default)
None
No specific sizing applied
Styling Classes
Class Name
Description
container_padding_x
Controls the horizontal padding of the container
container_padding_y
Controls the vertical padding of the container
container_expanding
Makes the container expand to fill available space
container_small
Applies styles for the small variant
container_narrow
Applies styles for the narrow variant
container_large
Applies styles for the large variant
container_responsive
Applies styles for the responsive variant
MainContent
The MainContent component is designed to wrap the main content of the application, with optional padding and an adjacent aside element for additional content. It provides a flexible layout structure for creating responsive designs.
The child elements to be rendered inside the main content.
class
Classes
Additional CSS classes to be applied to the main container.
expanding
bool
Determines if the main content should expand to fill the available space. Default is true.
padding_x
bool
If true, applies padding on the x-axis. Default is true.
padding_y
bool
If true, applies padding on the y-axis. Default is true.
aside
Option
Optional content to be rendered in an adjacent aside element.
Styling Classes
Class Name
Description
content_with_aside
Applied to the main content when an aside is present
content_aside
Styles the aside container
content_aside_container
Styles the inner container of the aside content
ContextMenu
The ContextMenu component presents a contextual menu that appears upon a right-click action. It is a versatile component suitable for providing additional options or actions related to specific content or interactions.
Optional custom element to display instead of the default copy icon
Styling Classes
Class Name
Description
copy_button
Base styling for the copy button
copy_button_icon
Styling for the default copy icon
copied_indicator
Styling for the success indicator after copying
Dialog
The Dialog component is a versatile UI element that displays content in a modal dialog. It is composed of several subcomponents to provide a flexible and customizable experience.
Usage
<DialogProvider>
<DialogTrigger id="example-dialog">
<Button>{"Open Dialog"}</Button>
</DialogTrigger>
<Dialog id="example-dialog">
<DialogHeader>
<DialogTitle>{"Dialog Title"}</DialogTitle>
</DialogHeader>
<DialogBody>{"This is a description inside the dialog."}</DialogBody>
<DialogFooter>
<DialogClose>
<Button>{"Close"}</Button>
</DialogClose>
</DialogFooter>
</Dialog>
</DialogProvider>
Components
DialogProvider
Prop
Type
Description
children
Children
Components that need access to the dialog context.
DialogTrigger
Prop
Type
Description
id
String
A unique identifier for the dialog.
children
Children
The trigger element that will open the dialog.
Dialog
Prop
Type
Description
id
String
A unique identifier matching the DialogTrigger id.
children
Children
The content to display inside the dialog.
DialogHeader, DialogBody, DialogFooter
Prop
Type
Description
children
Children
The content to display in the respective section.
DialogTitle
Prop
Type
Description
children
Children
The title content of the dialog.
DialogClose
Prop
Type
Description
children
Children
The element that will close the dialog when clicked.
Styling Classes
Class Name
Description
dialog_container
For the main dialog container with overlay
dialog_content
For the dialog content wrapper
dialog_header
For the header section of the dialog
dialog_title
For the dialog title
dialog_description
For the dialog description/body text
dialog_footer
For the footer section containing action buttons
Divider
The Divider component creates a horizontal separation between content with an optional text label in the middle.
Usage
<p>{"Content above the divider"}</p>
<Divider />
<p>{"Content below the divider"}</p>
<p>{"Content above the divider"}</p>
<Divider text="OR" />
<p>{"Content below the divider"}</p>
Props
Prop
Type
Description
class
String
Additional CSS classes
style
String
Inline CSS styles
text
String
Optional text to display in the middle of the divider
DragPoint
The DragPoint component creates a draggable element that provides callbacks for drag start and stop events, enabling custom behavior during these events.
Applied to the root element of the DragPoint component
Drawer
The Drawer component is a versatile UI element that slides in from the side of the screen, composed of several subcomponents to provide a flexible and customizable experience.
Child elements rendered inside the drawer component
side
DrawerSide
Side from which drawer slides in (Left, Right, Top, Bottom)
render
Callback<T, Html>
Callback to render the drawer content
curtain
bool
Whether to show a curtain behind drawer
curtain_content
Html
Content to show in the curtain
DrawerTrigger
Prop
Type
Description
children
Children
Child elements rendered inside trigger element
drawer
T
Identifier for the drawer to be opened
Drawer
Prop
Type
Description
children
Children
Child elements rendered inside drawer content
Other Components
DrawerClose: Element that triggers closing of the drawer
DrawerHeader: Header section of the drawer
DrawerTitle: Title of the drawer
DrawerFooter: Footer section of the drawer
Styling Classes
Class Name
Description
drawer_provider
For the main container of the drawer component
drawer_container
For the content area of the drawer
drawer_header
For the header section of the drawer
drawer_title
For the title within the drawer header
drawer_description
For the description text in the drawer
drawer_footer
For the footer section of the drawer
drawer_right
Applied when drawer slides from the right
drawer_top
Applied when drawer slides from the top
drawer_bottom
Applied when drawer slides from the bottom
drawer_left
Applied when drawer slides from the left
Dropdown
The Dropdown component provides a versatile dropdown menu with customizable items, optional icons, separators, and custom widgets, integrating with the Popover component for positioning and display control.
The GroupButton component is designed to group multiple buttons together, allowing for quick toggling between different options. It is highly customizable with flex direction, default active value, and more.
The child elements, typically GroupButtonTrigger components.
default_value
String
The default active button value.
class
Classes
Additional CSS classes for the container.
direction
FlexDirection
The direction of the flex container (Row or Column).
on_change
Callback
Callback function that is called when an option is selected.
GroupButtonTrigger
Prop
Type
Description
value
String
The value for the button.
children
Children
Content to be displayed inside the button.
class
Classes
Additional CSS classes for the button.
onclick
Callback
Callback function for the click event.
Styling Classes
Class Name
Description
group_button_container
For the outermost container of the group button
group_button_list
For the container that wraps the group buttons
group_button_trigger
For individual button triggers
group_button_trigger_active
For the active button trigger
group_button_trigger_inactive
For inactive button triggers
Iframe
The Iframe component allows embedding an iframe within a Yew application. It comes with support for injecting documents, event handling, and propagating events to the parent window, making it highly customizable and interactive.
Usage
<Iframe
class="w-full h-64"
body_class="p-4"
srcdoc={Some("<p>Hello, iframe content!</p>".to_string())}onkeydown={Callback::from(|_e: web_sys::KeyboardEvent| {
log::info!("Key down event within iframe");})}
>
{"Fallback content if no srcdoc is provided"}
</Iframe>
Props
Prop
Type
Description
children
Children
Content to be displayed if no srcdoc is provided.
class
Classes
CSS class(es) for the iframe element.
body_class
String
CSS class for the iframe body element.
srcdoc
Option
Optional HTML content to embed within the iframe.
onkeydown
Option<Callback<web_sys::KeyboardEvent>>
Callback for handling 'keydown' events in the iframe.
Styling Classes
Class Name
Description
iframe_container
For the main container of the iframe component
iframe_element
For the iframe element itself
Input
The Input component is a versatile text input field, supporting multiple event handlers and customizable properties. It provides a controlled input experience with extensive callback support for various events.
Base styling for the input. Default: 'border rounded px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-600'
Kanban
The Kanban component is a flexible task management system that allows users to organize tasks into columns and drag cards between them, following the Kanban methodology.
If true, allows dropping cards on multiple columns simultaneously. Default is false.
KanbanColumn
Prop
Type
Description
children
ChildrenWithProps
The cards to display in the column.
class
Classes
Additional CSS classes for the column.
header_class
Classes
Additional CSS classes for the column header.
body_class
Classes
Additional CSS classes for the column body.
id
AttrValue
Unique identifier for the column.
title
AttrValue
The title to display in the column header.
ondragenter
Option<Callback>
Callback when a draggable item enters the column.
ondragleave
Option<Callback>
Callback when a draggable item leaves the column.
ondragover
Option<Callback>
Callback when a draggable item is over the column.
ondrop
Option<Callback<(String, String, Option)>>
Callback when a card is dropped on the column. Receives (card_id, column_id, target_card_id).
KanbanCard
Prop
Type
Description
children
Children
The content to display in the card.
class
Classes
Additional CSS classes for the card.
id
AttrValue
Unique identifier for the card.
column_id
Option
ID of the column the card belongs to.
title
Option
Optional title to display at the top of the card.
order
Option
Ordering position within the column.
ondragstart
Option<Callback>
Callback when dragging of the card starts.
ondragend
Option<Callback>
Callback when dragging of the card ends.
ondragover
Option<Callback>
Callback when a draggable item is over the card.
ondragenter
Option<Callback>
Callback when a draggable item enters the card.
ondragleave
Option<Callback>
Callback when a draggable item leaves the card.
onclick
Option<Callback>
Callback when the card is clicked.
Styling Classes
Class Name
Description
kanban_container
Styles for the main Kanban board container.
kanban_column
Styles for each column in the Kanban board.
kanban_column_header
Styles for the column header containing the title.
kanban_column_body
Styles for the column body that contains the cards.
kanban_column_over
Styles applied when a card is being dragged over a column.
kanban_card
Styles for each card in the Kanban board.
kanban_card_title
Styles for the card title.
kanban_card_content
Styles for the card content area.
kanban_card_dragging
Styles applied to a card when it's being dragged.
kanban_card_drag_target
Styles applied when another card is being dragged over it.
Label
The Label component is designed to provide accessible text labels for form elements, enhancing usability and accessibility. It can be styled with custom classes and linked to specific form elements using the for_id attribute.
The ID of the form element the label is associated with.
Styling Classes
Class Name
Description
label_base
Base styling for the label. Default: Basic styling for the label component.
MediaQuery
The MediaQuery hook (use_media_query) allows components to respond to changes in media queries, enabling responsive design and adaptations to user preferences like dark mode.
The MultiColumnSidebar component provides a sophisticated multi-level navigation interface with multiple columns, ideal for complex application navigation hierarchies.
Content for the backdrop when sidebar is open in mobile.
SidebarColumn
Prop
Type
Description
children
Children
Content for the column.
width
Option
Fixed width in pixels.
hide_when_folded
bool
Whether to hide when sidebar is folded.
header
Option
Optional header content.
footer
Option
Optional footer content.
class
Classes
Additional CSS classes.
Styling Classes
Class Name
Description
sidebar_column
For individual columns within the multi-column layout
sidebar_column_header
For the header section of a sidebar column
sidebar_column_content
For the main content area of a sidebar column
sidebar_column_footer
For the footer section of a sidebar column
Notification
The Notification component provides a system for displaying temporary, non-intrusive messages to users. It requires a NotificationProvider at a higher level in the component tree and uses the use_notify hook for triggering notifications.
Returns a callback that can be used to show notifications. The callback accepts a tuple with the following parameters:
Parameter
Type
Description
title
String
The title of the notification.
description
String
The description or message of the notification.
action
Option
Optional action element (like a button or link).
Styling Classes
Class Name
Description
notification_container
For individual notification containers
notification_content
For the content area of a notification
notification_title
For the notification title
notification_description
For the notification description/message
notification_timestamp
For the relative time display
notification_close_button
For the close/dismiss button
notification_close_icon
For the icon within the close button
notification_action_container
For the container of action elements
notification_list_container
For the container of all notifications
PageContent
The PageContent component provides a standardized container for the main content area of your application, with support for paddings, backgrounds, and borders.
Usage
<PageContent>
<H3>{"Page Title"}</H3>
<Paragraph>{"This is an example of basic page content with default styling. It provides proper spacing and a clean background."}</Paragraph>
<Button class="mt-4">{"Action Button"}</Button>
</PageContent>
Props
Prop
Type
Description
children
Children
The content to display within the page content area
class
String
Additional CSS classes
Styling Classes
Class Name
Description
page_content
For the main container of the page content area
PageHeader
The PageHeader component provides a flexible header element for pages, which includes a title and optional child elements. This can be useful for providing consistent headers across different sections of an application.
Optional child elements to be rendered alongside the title
Styling Classes
Class Name
Description
page_header_container
For the main container of the page header
page_header_title
For the title text in the header
page_header_actions
For the container of action elements
Pagination
The Pagination component helps with navigation between pages of content. It provides a user-friendly interface to browse through multiple pages of data.
Callback function that receives the new page number when a page is selected
next
Option
Custom content for the 'Next' button
prev
Option
Custom content for the 'Previous' button
Styling Classes
Class Name
Description
pagination_container
For the main pagination container
pagination_item
For individual page number buttons
pagination_active
For the currently active page button
pagination_ellipsis
For the ellipsis indicator
pagination_prev
For the previous page button
pagination_next
For the next page button
PaintCanvas
The PaintCanvas component is a versatile drawing canvas that supports image loading and drawing with mouse events. It is useful for creating interactive web drawing applications.
The Placeholder component serves as a content placeholder with a dashed background pattern. It's useful for indicating where actual content will eventually go or for displaying loading states.
Additional CSS classes to apply to the Placeholder component
text
String
The text to display inside the Placeholder
Styling Classes
Class Name
Description
placeholder_container
Styles for the main container of the placeholder
placeholder_svg
Styles for the SVG element that creates the dashed background
placeholder_text
Styles for the text content within the placeholder
Popover
The Popover component is a versatile UI element that displays content in a floating container when a trigger element is clicked. It's ideal for displaying additional information or actions without redirecting users away from their current context.
The child elements to be rendered inside the popover component.
class
Classes
Additional CSS classes for styling the popover container.
PopoverTrigger
Prop
Type
Description
children
Children
The child elements to be rendered inside the trigger element.
as_child
bool
Whether the trigger should be rendered as a child element.
class
Classes
Additional CSS classes for styling the trigger.
PopoverContent
Prop
Type
Description
children
Children
The child elements to be rendered inside the popover content.
class
Classes
Additional CSS classes for styling the content container.
position
PopoverPosition
The position of the popover relative to its trigger.
Styling Classes
Class Name
Description
popover_container
For the main container of the popover
popover_trigger
For the trigger element
popover_content
For the content container
popover_position_north_start
For positioning the popover to the north start of the trigger
popover_position_north_middle
For positioning the popover to the north middle of the trigger
popover_position_north_end
For positioning the popover to the north end of the trigger
popover_position_south_start
For positioning the popover to the south start of the trigger
popover_position_south_middle
For positioning the popover to the south middle of the trigger
popover_position_south_end
For positioning the popover to the south end of the trigger
popover_position_east_start
For positioning the popover to the east start of the trigger
popover_position_east_middle
For positioning the popover to the east middle of the trigger
popover_position_east_end
For positioning the popover to the east end of the trigger
popover_position_west_start
For positioning the popover to the west start of the trigger
popover_position_west_middle
For positioning the popover to the west middle of the trigger
popover_position_west_end
For positioning the popover to the west end of the trigger
Resizable
The Resizable component allows you to create resizable areas within your application. Users can resize these areas using various handles positioned around the element's edges and corners.
Initial coordinates of the resizable area: (start_x, start_y, end_x, end_y)
on_coordinates_change
Callback<(f64, f64, f64, f64)>
Callback function that is called when the coordinates change
children
Children
The child elements to be rendered inside the resizable area
north
bool
Enable the north handle for resizing
north_west
bool
Enable the north-west corner handle for resizing
north_east
bool
Enable the north-east corner handle for resizing
east
bool
Enable the east handle for resizing
south_east
bool
Enable the south-east corner handle for resizing
south
bool
Enable the south handle for resizing
south_west
bool
Enable the south-west corner handle for resizing
west
bool
Enable the west handle for resizing
Styling Classes
Class Name
Description
resizable_container
For the main container of the resizable component
resizable_box
For the resizable box itself
resizable_handle_visible
For visible resize handles
resizable_handle_hidden
For hidden resize handles
resizable_handle_nw
For the northwest corner handle
resizable_handle_ne
For the northeast corner handle
resizable_handle_sw
For the southwest corner handle
resizable_handle_se
For the southeast corner handle
resizable_handle_n
For the north edge handle
resizable_handle_s
For the south edge handle
resizable_handle_w
For the west edge handle
resizable_handle_e
For the east edge handle
Select
The Select component is a customizable dropdown that allows users to choose an option from a list. It provides a clean and intuitive interface for selection tasks, with support for various data types.
Usage
<Select<String>
options={vec!["Apple".to_string(),"Banana".to_string(),"Cherry".to_string()]}selected={None::<String>}onchange={Callback::from(|selected| {// Handle the selection})}
/>
Props
Prop
Type
Description
options
Vec
A vector of options to display in the dropdown.
selected
Option
The currently selected option, if any.
onchange
Callback
A callback function that is called when an option is selected.
Template Parameters
Parameter
Description
T
The type of the options. Must implement Clone, PartialEq, ToString, and 'static.
Styling Classes
Class Name
Description
select_container
For the main container of the select component
select_trigger
For the trigger button that opens the dropdown
select_trigger_placeholder
For the placeholder text in the trigger button
select_trigger_icon
For the dropdown icon in the trigger button
select_content_container
For the container of the dropdown content
select_content_list
For the list of options in the dropdown
select_item
For individual items in the dropdown list
Selectable
The Selectable component provides functionality for selecting and highlighting elements within a selectable area. It uses internal state management to maintain the selection and hover states.
The child elements to be rendered inside the selectable component.
class
Classes
CSS classes to apply to the component.
tag
String
The HTML tag to be used for this component.
select_mode
bool
Indicates whether the selectable component is in selection mode.
style
String
Inline styles to apply to the component.
SelectableArea
Prop
Type
Description
children
Children
The child elements to be rendered inside the selectable area.
onselect
Callback<Option>
Callback function to handle selection changes.
select_mode
bool
Indicates whether the selectable area is in selection mode.
SelectableIndicator
Prop
Type
Description
class
Classes
CSS classes to apply to the indicator.
SelectableVTag
Prop
Type
Description
node
Box
The VTag node to be wrapped by the selectable functionality.
node_ref
NodeRef
A reference to the DOM node.
onclick
Callback
Callback function for handling click events.
id
String
The unique identifier for the VTag.
onmouseenter
Callback
Callback function for handling mouse enter events.
onmouseleave
Callback
Callback function for handling mouse leave events.
Styling Classes
Class Name
Description
selectable_indicator
For the visual indicator of the selected area.
selectable_hover
For the hover effect on selectable items.
selectable_selected
For the selected state of items.
selectable_cursor
For the cursor style on selectable items.
Sidebar
The Sidebar component provides a collapsible side navigation panel that can be used for application menus, navigation links, and other sidebar content.
SidebarHeading - Used to create section headings in the sidebar
SidebarMenu - Container for sidebar menu items
SidebarItem - Individual navigation item in the sidebar
SidebarLink - Navigation link that supports Yew Router integration
SwitchButton
The SwitchButton component is a customizable switch that can be toggled on or off. It includes support for custom icons and is designed with accessibility in mind.
The value of the tab to be activated when clicked.
children
Children
The content displayed in the trigger.
class
Classes
Additional CSS classes for the trigger.
TabsContent
Prop
Type
Description
value
String
The value of the tab this content belongs to.
children
Children
The content to display when this tab is active.
class
Classes
Additional CSS classes for the content.
Styling Classes
Class Name
Description
tabs_container
For the main container of the tabs component
tabs_list
For the list of tab triggers
tabs_trigger
For the tab triggers/buttons
tabs_trigger_active
For the currently active tab trigger
tabs_trigger_inactive
For inactive tab triggers
tabs_content
For the content area of each tab
TagInput
The TagInput component allows users to input and manage multiple tags or keywords with optional autocomplete suggestions.
Usage
<TagInput
placeholder="Type and press Enter to add a tag"
default_value={vec!["React".to_string(),"Rust".to_string()]}candidates={Callback::from(|input:String| {let suggestions = vec!["React","Rust","Ruby","Remix"];
suggestions.into_iter().filter(|&s| s.to_lowercase().contains(&input.to_lowercase())).map(|s| s.to_string()).collect::<Vec<_>>()})}onupdate={Callback::from(|tags:Vec<String>| {// Handle updated tags})}
/>
Props
Prop
Type
Description
id
Option
Optional ID for the input element.
default_value
Vec
Initial tags to display.
candidates
Option<Callback<String, Vec>>
Callback that returns tag suggestions based on input.
onupdate
Option<Callback<Vec>>
Callback triggered when tags are added or removed.
placeholder
String
Placeholder text for the input.
Styling Classes
Class Name
Description
tag_input_container
For the main container of the tag input component
tag_input_field
For the text input field
tag_item
For individual tag items
tag_item_text
For the text content of a tag
tag_item_remove_button
For the remove button on each tag
tag_suggestions
For the container of autocomplete suggestions
tag_suggestion_item
For individual suggestion items
TailwindColorPicker
The TailwindColorPicker component provides a color selection interface based on Tailwind CSS color classes, allowing users to pick both colors and shades.
Usage
let color = use_state(|| "blue".to_string());let shade = use_state(|| 500);let oncolorchange = {let color = color.clone();let shade = shade.clone();Callback::from(move |(new_color, new_shade)| {
color.set(new_color);
shade.set(new_shade);})};
<TailwindColorPicker
color={(*color).clone()}
shade={*shade}{oncolorchange}
/>
Props
Prop
Type
Description
color
String
Default selected color. Defaults to 'blue'.
shade
u16
Default shade of the color. Defaults to 500.
oncolorchange
Callback<(String, u16)>
Callback function called when a color is selected.
Styling Classes
Class Name
Description
tailwind_color_picker_container
For the main container of the color picker
tailwind_color_picker_button
For the button that toggles the palette
tailwind_color_picker_palette
For the dropdown container of the color palette
tailwind_color_picker_color
For individual color options in the palette
tailwind_color_picker_shade
For individual shade options in the palette
Textarea
The Textarea component provides a multi-line text input field with support for various properties to customize its appearance and behavior.
Usage
// Static Textarea
<Textarea
value="Initial text"
placeholder="Enter some text..."
class={classes!("mb-4")}
/>
// Dynamic Textarealet value = use_state(|| "".to_string());let oninput = {let value = value.clone();Callback::from(move |e:InputEvent| {let target = e.target_unchecked_into::<web_sys::HtmlTextAreaElement>();
value.set(target.value());})};
<Textarea
value={(*value).clone()}
oninput={oninput}
placeholder="Enter some text..."
/>
Props
Prop
Type
Description
value
String
The current value of the textarea.
oninput
Callback
A callback for handling input events.
placeholder
String
Placeholder text for the textarea.
class
Classes
Additional CSS classes for the textarea.
id
String
The id attribute of the textarea.
name
String
The name attribute of the textarea.
disabled
bool
If true, the textarea will be disabled.
Styling Classes
Class Name
Description
textarea_base
Base styling for the textarea component
Toggle
The Toggle component provides a button that can be toggled between two states, often used for text formatting controls or feature toggles.
Typography components provide styled HTML heading and paragraph elements. Each component applies consistent styling based on your application's brand guidelines.
Usage
<div>
<H1 class={classes!("mb-4")}>{"This is an H1 Heading"}</H1>
<H2 class={classes!("mb-4")}>{"This is an H2 Heading"}</H2>
<H3 class={classes!("mb-4")}>{"This is an H3 Heading"}</H3>
<H4 class={classes!("mb-4")}>{"This is an H4 Heading"}</H4>
<H5 class={classes!("mb-4")}>{"This is an H5 Heading"}</H5>
<H6 class={classes!("mb-4")}>{"This is an H6 Heading"}</H6>
<Paragraph class={classes!("mb-4")}>{"This is a paragraph with some example text."}</Paragraph>
</div>
Props
Prop
Type
Description
children
Children
Child elements to be rendered inside the component.
class
Classes
Additional CSS classes to apply.
Styling Classes
Class Name
Description
typography_h1
For H1 elements
typography_h2
For H2 elements
typography_h3
For H3 elements
typography_h4
For H4 elements
typography_h5
For H5 elements
typography_h6
For H6 elements
typography_p
For paragraph elements
WindowProvider
The WindowProvider component offers a context provider for managing the window object associated with an iframe. This enables descendant components to access and interact with the global window object effectively.