submit-button
shuip/submit-buttonFreeComponent
shuip publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shuip on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shuip.plvo.dev/r/submit-button.jsonSource
1import { ReloadIcon } from '@radix-ui/react-icons';2import type { VariantProps } from 'class-variance-authority';3import type * as React from 'react';4import { Button, type buttonVariants } from '@/components/ui/button';56type ButtonProps = React.ComponentProps<'button'> &7 VariantProps<typeof buttonVariants> & {8 asChild?: boolean;9 };1011export interface SubmitButtonProps extends ButtonProps {12 children?: React.ReactNode;13 disabled?: boolean;14 loading?: boolean;15 icon?: React.JSX.Element;16}1718export function SubmitButton({19 children,20 disabled,21 loading,22 icon = <ReloadIcon className='mr-2 size-4 animate-spin' aria-label='Loading' />,23 ...props24}: SubmitButtonProps) {25 return (26 <Button type='submit' aria-label='Submit' disabled={disabled || loading} {...props}>27 {loading && icon}28 {children || 'Submit'}29 </Button>30 );31}
What it pulls in
npm packages
Other registry items
Files it writes
More from shuip
All 52 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| confirmation-dialogconfirmation-dialog | shuip | Components | Free | 1 dep | |
| copy-buttoncopy-button | shuip | Components | Free | 3 deps | |
| hover-revealhover-reveal | shuip | Components | Free | 1 dep | |
| rhf-address-fieldrhf-address-field | shuip | Components | Free | 5 deps · 2 files | |
| rhf-autocomplete-fieldrhf-autocomplete-field | shuip | Components | Free | 4 deps | |
| rhf-checkbox-fieldrhf-checkbox-field | shuip | Components | Free | 3 deps | |
| rhf-combobox-fieldrhf-combobox-field | shuip | Components | Free | 5 deps | |
| rhf-date-fieldrhf-date-field | shuip | Components | Free | 6 deps |
