Action Input
tetra-ui/action-inputFreeComponent
A component that allows a user to trigger an action and displays a value attached to the action.
Live preview
live · rendered by the registry
Rendered by tetra-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://tetra-ui.com/r/action-input.jsonSource
1import { Text, View } from "react-native";2import { cn } from "@/lib/utils";3import { ChevronRightIcon } from "./icons";4import {5 InputAddon,6 type InputAddonChildren,7 InputAddonIcon,8 InputPressable,9 type InputPressableProps,10 useInputAddons,11} from "./input";1213// Types14export type ActionInputProps = InputPressableProps & {15 value?: string;16 placeholder: string;17 children?: InputAddonChildren;18};1920// Components21export const ActionInput = ({22 value,23 placeholder,24 children,25 className,26 ...props27}: ActionInputProps) => {28 const { startAddons, endAddons, pressableClassName } =29 useInputAddons(children);3031 return (32 <InputPressable33 {...props}34 className={cn(pressableClassName, "pr-0", className)}35 >36 {startAddons}3738 <View className="grow">39 {value ? (40 <Text className="text-base text-foreground">{value}</Text>41 ) : (42 <Text className="text-base text-muted-foreground">{placeholder}</Text>43 )}44 </View>4546 {endAddons.length ? (47 endAddons48 ) : (49 <InputAddon align="inline-end">50 <InputAddonIcon>51 <ChevronRightIcon />52 </InputAddonIcon>53 </InputAddon>54 )}55 </InputPressable>56 );57};
What it pulls in
Other registry items
Files it writes
More from tetra-ui
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | tetra-ui | Components | Free | 1 dep | |
| Alertalert | tetra-ui | Components | Free | no deps | |
| Avataravatar | tetra-ui | Components | Free | no deps | |
| Badgebadge | tetra-ui | Components | Free | no deps | |
| Bottom Sheetbottom-sheet | tetra-ui | Components | Free | 4 deps · 7 files | |
| Buttonbutton | tetra-ui | Components | Free | no deps | |
| Cardcard | tetra-ui | Components | Free | no deps | |
| Checkboxcheckbox | tetra-ui | Components | Free | 1 dep |
