use topcoat::{ Result, view::{Attributes, StaticClass, View, class, component, view}, }; /// Classes for the input's dimensions, border, and interaction states. Focus uses the /// global `:focus-visible` outline from `styles.css`. const INPUT: StaticClass = class!( "h-8 w-full min-w-0 rounded-control border border-border bg-card px-2.5", "text-sm text-foreground transition-colors duration-150 ease-out", "placeholder:text-muted-foreground", "file:mr-3 file:h-full file:border-0 file:bg-transparent file:text-sm file:font-medium", "aria-invalid:border-destructive", "disabled:cursor-not-allowed disabled:opacity-50", ); /// A styled input, 32px tall with a hairline border. /// /// Pass input attributes and event handlers through `attrs`. Extra classes are added to /// the input's classes. It fills its container by default. Set `aria-invalid="true"` to /// show the error border. /// /// ```ignore /// view! { /// input(attrs: attributes! { type="email" placeholder="you@example.com" }) /// } /// ``` #[component] pub async fn input(#[default] mut attrs: Attributes) -> Result { Ok(view! { }) }