UNPKG

tharikida-ui

Version:

A modern, lightweight React UI component library with built-in theming, accessibility, and full TypeScript support. Create beautiful, responsive, and customizable web apps faster with ready-to-use components for any project.

43 lines (42 loc) 1.66 kB
import React from "react"; /** * `Dropdown` is a customizable dropdown/select component that supports theming, custom styles, and controlled/uncontrolled usage. * * @param {object} props - The properties to customize the `Dropdown` component. * @param {string[]} props.options - The list of options to display in the dropdown. * @param {string} [props.defaultOption] - The default selected option. * @param {(value: string) => void} [props.onChange] - Callback when the selected option changes. * @param {string} [props.width] - Custom width for the dropdown. * @param {React.CSSProperties} [props.styles] - Custom styles for the dropdown container. * @param {number} [props.cornerRadius] - Custom border radius for the dropdown and options. Overrides theme.cornerRadius if provided. * * @returns {JSX.Element} A styled dropdown component. */ interface DropdownProps { /** * The list of options to display in the dropdown. */ options: string[]; /** * The default selected option. */ defaultOption?: string; /** * Callback when the selected option changes. */ onChange?: (value: string) => void; /** * Custom width for the dropdown. */ width?: string; /** * Custom styles for the dropdown container. */ styles?: React.CSSProperties; /** * Custom border radius for the dropdown and options. Overrides theme.cornerRadius if provided. */ cornerRadius?: number; } declare const Dropdown: ({ options, defaultOption, onChange, width, styles, cornerRadius, }: DropdownProps) => import("react/jsx-runtime").JSX.Element; export default Dropdown;