### Install Mielo UI Packages Source: https://context7.com/mielo-ui/mielo-react/llms.txt Installs the necessary Mielo UI packages, including the core CSS framework and the React component library, using npm. ```bash npm install @mielo-ui/mielo @mielo-ui/mielo-react ``` -------------------------------- ### Modal Component Example - React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Shows how to implement a Modal component for displaying content in a full-screen overlay. Includes state management for opening/closing, backdrop click, and escape key handling. Requires the @mielo-ui/mielo-react library and React's useState hook. ```tsx import { Modal } from "@mielo-ui/mielo-react" import { useState } from "react" function ModalExample() { const [isOpen, setIsOpen] = useState(false) return (
setIsOpen(false)} >

Modal Content

This content appears in a modal overlay.

Click outside or press Escape to close.

) } ``` -------------------------------- ### Install Mielo UI Packages Source: https://github.com/mielo-ui/mielo-react/blob/main/README.md Installs the core mielo UI package and the mielo-react component library using npm or yarn. This is the first step to using Mielo components in your project. ```sh npm install @mielo-ui/mielo @mielo-ui/mielo-react # or use "yarn add" instead ``` -------------------------------- ### Window Component Examples in React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Illustrates the Mielo UI Window component for creating desktop application-style windows. Features include optional header bars, split view layouts, and window controls for Tauri/Electron apps. Supports transparent and accent-colored themes, and draggable headers. ```tsx import { Window, HeaderBar, View, Button } from "@mielo-ui/mielo-react" function WindowExample() { return (
{/* Basic window with headerbar */} , right:
, content: Main content }} /> {/* Transparent window */} Transparent window content {/* Accent colored window */} Success themed window {/* Window for Tauri/Electron with draggable header */} Desktop app content ) } ``` -------------------------------- ### Label Component Examples - React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates various ways to use the Label component for styled labels and badges. Supports different accents, sizes, styles, colors, and floating positions. Requires the @mielo-ui/mielo-react library. ```tsx import { Label } from "@mielo-ui/mielo-react" function LabelExample() { return (
{/* Basic label */} {/* Accent colors */} {/* Size variants */} {/* Style variants */} {/* Color variants */} {/* Floating labels (positioned at corners) */}
) } ``` -------------------------------- ### Item Component Examples - React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Illustrates the usage of the Item component for creating versatile list items. Supports titles, descriptions, icons, side content, labels, clickable actions, links, and various layout/style variants. Requires the @mielo-ui/mielo-react library. ```tsx import { Item } from "@mielo-ui/mielo-react" function ItemExample() { return (
{/* Basic item with title */} {/* Item with title and description */} {/* Item with icon */} *} /> {/* Item with side content */} 5 new} /> {/* Item with label badge */} New} /> {/* Clickable item with active state */} console.log("Clicked")} /> {/* Item as link */} {/* Accent and color variants */} {/* Layout variants */} {/* Custom content instead of title/description */} Custom Content

Any React content here

} /> {/* Hover state */} ) } ``` -------------------------------- ### Mielo UI React Entry Component Example Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates the usage of the Mielo UI React Entry component, a styled text input with floating label, prefix/postfix slots, and visual variants. It handles focus states for label and placeholder animation. Dependencies include React and the @mielo-ui/mielo-react library. ```tsx import { Entry } from "@mielo-ui/mielo-react" import { useState } from "react" function EntryExample() { const [username, setUsername] = useState("") const [password, setPassword] = useState("") return (
{/* Basic entry with floating label */} setUsername(e.target.value)} /> {/* Password input */} setPassword(e.target.value)} /> {/* Accent colors */} {/* Style variants */} {/* Size variants */} {/* With prefix and postfix */} @} postfix={} /> {/* Disabled state */} {/* With container ID for styling */}
) } ``` -------------------------------- ### Build Mielo React Library from Source Source: https://github.com/mielo-ui/mielo-react/blob/main/README.md Provides commands to clone the Mielo React repository, install dependencies, format code, and build the library. This is for developers who want to build from source. ```sh git clone https://github.com/mielo-ui/mielo-react cd mielo-react npm install # or "yarn" npm run fmt # format & linting components npm build # build module library with .d.ts ``` -------------------------------- ### View Component Examples (React) Source: https://context7.com/mielo-ui/mielo-react/llms.txt The View component serves as a versatile content container, offering various background styles (panel, windows, content, osd), scrolling capabilities, and decorative borders. It also supports activatable states for interactive elements and can be themed with accent colors or custom colors. ```tsx import { View } from "@mielo-ui/mielo-react" function ViewExample() { return (
{/* Basic view */}

Default view content

{/* Background styles: panel, windows, content, osd */} Panel background Windows background Content background OSD (on-screen display) background {/* Scrollable view */}

Scrollable content that exceeds container height

{/* Bordered view */}

View with border

{/* Activatable view (hover/focus states) */}

Interactive view with hover states

{/* Accent colored view */}

Success themed view

{/* Color variants */} Blue view Purple view
) } ``` -------------------------------- ### Mielo React Button Component Examples Source: https://context7.com/mielo-ui/mielo-react/llms.txt Showcases various configurations and styles for the Mielo React Button component. This includes basic usage, accent colors, size variants, style modifiers, icon integration, and usage as a link or within a button group. ```tsx import { Button } from "@mielo-ui/mielo-react" function ButtonExample() { return (
{/* Basic button with label */}
) } ``` -------------------------------- ### Rows Component Example - React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Illustrates the Mielo UI Rows component for creating structured form layouts. It showcases basic row usage, rows with select and entry inputs, and a more complex settings page example. Dependencies include React's useState hook and various Mielo UI components like Rows, Select, Entry, and Item. ```tsx import { Rows, Select, Entry, Item, OptionValue } from "@mielo-ui/mielo-react" import { useState } from "react" function RowsExample() { const [theme, setTheme] = useState() const [name, setName] = useState("") const themeOptions: OptionValue[] = [ { value: "light", title: "Light" }, { value: "dark", title: "Dark" }, { value: "system", title: "System" } ] return (
{/* Basic rows container */} Active} /> {/* Rows with select input */} {/* Rows with entry input */} setName(e.target.value)} /> {/* Settings page example */} } /> {}} /> console.log("Show about")} />
) } ``` -------------------------------- ### Tabs Component Examples in React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates the Mielo UI Tabs component for creating tabbed interfaces. Supports array-based and record-based tab definitions, animated indicators, accent colors, and transparent styles. Also shows custom tab content using RawTabs and Tab components. ```tsx import { Tabs, Tab, RawTabs } from "@mielo-ui/mielo-react" import { useState } from "react" function TabsExample() { const [selected, setSelected] = useState("home") // Array-based tabs const tabsArray = [ { name: "home", title: "Home", icon: H }, { name: "profile", title: "Profile" }, { name: "settings", title: "Settings", accent: "warning" as const }, { name: "help", title: "Help", color: "blue" } ] // Record-based tabs const tabsRecord = { home: { name: "home", title: "Home" }, profile: { name: "profile", title: "Profile" }, settings: { name: "settings", title: "Settings" } } return (
{/* Basic tabs with array */} setSelected(name)} /> {/* Tabs with animated indicator */} {/* Tabs with accent color */} {/* Transparent tabs */} {/* Record-based tabs */} {/* Tab content based on selection */}
{selected === "home" &&

Home content

} {selected === "profile" &&

Profile content

} {selected === "settings" &&

Settings content

} {selected === "help" &&

Help content

}
{/* Raw tabs for custom content */}
) } ``` -------------------------------- ### Mielo React Checkbox Component Examples Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates the usage of the Mielo React Checkbox component, including basic functionality, accent colors, size variants, disabled states, circular styling, and toggle mode (switch). It also shows how to use custom icons and children for labels. ```tsx import { Checkbox } from "@mielo-ui/mielo-react" import { useState } from "react" function CheckboxExample() { const [isChecked, setIsChecked] = useState(false) return (
{/* Basic checkbox with label */} setIsChecked(e.target.checked)} /> {/* Checkbox with accent colors */} {/* Size variants */} {/* Disabled state */} {/* Circular style */} {/* Toggle mode (switch style) */} setIsChecked(e.target.checked)} /> {/* Toggle with custom icons */} ON, unchecked: OFF }, layout: { checked: *, unchecked: - } }} /> {/* Using children instead of label */} Custom content as children
) } ``` -------------------------------- ### Dropdown Component Example in React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates the usage of the Mielo UI Dropdown component in React. It covers basic dropdown functionality, programmatic control via ref, custom menu height, and custom class names for styling. This component handles open/close state, click-outside detection, and keyboard navigation. ```tsx import { Dropdown, DropdownHandles, Button, List, Item } from "@mielo-ui/mielo-react" import { useRef } from "react" function DropdownExample() { const dropdownRef = useRef(null) return (
{/* Basic dropdown */} (
)} onOpen={() => console.log("Dropdown opened")} onClose={() => console.log("Dropdown closed")} /> } /> {/* Bordered header bar */} {/* Transparent header bar */} {/* Accent colored header bar */} {/* Desktop draggable header (for Tauri/Electron) */} ) } ``` -------------------------------- ### Collapsible Component Example - React Source: https://context7.com/mielo-ui/mielo-react/llms.txt Demonstrates the Mielo UI Collapsible component for creating expandable content sections. It shows basic usage, an accordion pattern, and how to manage multiple open sections. Dependencies include React's useState hook and Mielo UI's Collapsible and Button components. ```tsx import { Collapsible, Button } from "@mielo-ui/mielo-react" import { useState } from "react" function CollapsibleExample() { const [isOpen, setIsOpen] = useState(false) const [sections, setSections] = useState({ a: true, b: false, c: false }) return (
{/* Basic collapsible */}
{/* Multiple open sections */}
) } ``` -------------------------------- ### Mielo UI React Select Component Example Source: https://context7.com/mielo-ui/mielo-react/llms.txt Illustrates the Mielo UI React Select component, a customizable dropdown for selection. It supports various options, labels, styling, and event callbacks. Internally uses the Dropdown component and allows custom item rendering. Dependencies include React and @mielo-ui/mielo-react. ```tsx import { Select, OptionValue } from "@mielo-ui/mielo-react" import { useState } from "react" function SelectExample() { const [selected, setSelected] = useState() const options: OptionValue[] = [ { value: "react", title: "React" }, { value: "vue", title: "Vue.js" }, { value: "angular", title: "Angular" }, { value: "svelte", title: "Svelte", description: "Compiler-based framework" } ] return (
{/* Basic select */} {/* Style variants */} {/* Size variants */} {/* With callbacks for open/close events */} Icon} postfix={*} /> {/* Custom menu height */}