@manta-eu/react/button
Reference for @manta-eu/react/button as it is on main.
Type Aliases
BaseButtonProps
BaseButtonProps =
Omit<ComponentProps<"button">,"children"> &VariantPropsOf<typeofbuttonConfig> &object
Type Declaration
asChild?
optionalasChild?:boolean
isLoading?
optionalisLoading?:boolean
BaseLinkProps
BaseLinkProps =
object
Properties
component?
optionalcomponent?:ElementType
href
href:
string
rounded?
optionalrounded?:VariantPropsOf<typeofbuttonConfig>["rounded"]
size?
optionalsize?:VariantPropsOf<typeofbuttonConfig>["size"]
variant?
optionalvariant?:VariantPropsOf<typeofbuttonConfig>["variant"]
ButtonProps
ButtonProps = (
IconOnlyButtonProps|RegularButtonProps) &object
Type Declaration
ref?
optionalref?:Ref<HTMLButtonElement>
ButtonVariant
ButtonVariant =
VariantPropsOf<typeofbuttonConfig>["variant"]
IconOnlyButtonProps
IconOnlyButtonProps =
BaseButtonProps&object
Type Declaration
aria-label
aria-label:
string
children?
optionalchildren?:never
icon
icon:
ComponentType<{className?:string; }>
iconOnly
iconOnly:
true
label?
optionallabel?:never
showLeftIcon?
optionalshowLeftIcon?:never
showRightIcon?
optionalshowRightIcon?:never
LinkProps
LinkProps =
Omit<ComponentPropsWithoutRef<"a">,"href"> &BaseLinkProps&object
Type Declaration
ref?
optionalref?:Ref<HTMLAnchorElement>
RegularButtonProps
RegularButtonProps =
BaseButtonProps&object
Type Declaration
children?
optionalchildren?:ReactNode
icon?
optionalicon?:ComponentType<{className?:string; }>
iconOnly?
optionaliconOnly?:false|never
label?
optionallabel?:string
showLeftIcon?
optionalshowLeftIcon?:boolean
showRightIcon?
optionalshowRightIcon?:boolean
Variables
buttonConfig
constbuttonConfig:object
Type Declaration
base
base:
string[]
defaultVariants
defaultVariants:
object
defaultVariants.rounded
readonlyrounded:"full"="full"
defaultVariants.size
readonlysize:"base"="base"
defaultVariants.variant
readonlyvariant:"primary"="primary"
variants
variants:
object
variants.rounded
rounded:
object
variants.rounded.full
full:
string="rounded-full"
variants.rounded.lg
lg:
string="rounded-lg-v4"
variants.rounded.md
md:
string="rounded-md-v4"
variants.rounded.sm
sm:
string="rounded-sm-v4"
variants.size
size:
object
variants.size.base
base:
string="h-10 px-4 typography-caption-medium [&>svg]:size-5 [&_svg[data-loader]]:size-5"
variants.size.lg
lg:
string="h-12 px-4 typography-body-medium [&>svg]:size-6 [&_svg[data-loader]]:size-6"
variants.size.sm
sm:
string="h-8 px-3 typography-tiny-medium [&>svg]:size-5 [&_svg[data-loader]]:size-4"
variants.size.xs
xs:
string="h-7 px-2 typography-tiny-medium [&>svg]:size-4 [&_svg[data-loader]]:size-3.5"
variants.variant
variant:
object
variants.variant.destructive
destructive:
string="bg-error text-error-foreground hover:bg-error-hover focus:ring-error-foreground/25"
variants.variant.ghost
ghost:
string="bg-transparent hover:bg-faint"
variants.variant.primary
primary:
string="bg-primary text-primary-foreground hover:bg-primary-hover"
variants.variant.secondary
secondary:
string="bg-secondary text-secondary-foreground hover:bg-secondary-hover"
variants.variant.tertiary
tertiary:
string="bg-input text-default-foreground border border-muted-border hover:bg-input-hover focus:border-active-border"
buttonIconOnlySizeClasses
constbuttonIconOnlySizeClasses:object
Type Declaration
base
base:
string="has-[>svg:only-child]:size-10 has-[>svg:only-child]:p-0 "
lg
lg:
string="has-[>svg:only-child]:size-12 has-[>svg:only-child]:p-0 "
sm
sm:
string="has-[>svg:only-child]:size-8 has-[>svg:only-child]:p-0 "
xs
xs:
string="has-[>svg:only-child]:size-7 has-[>svg:only-child]:p-0 "
Functions
Button()
Button(
props):Element
Parameters
props
Returns
Element
buttonVariants()
buttonVariants(
props?):string
Parameters
props?
VariantPropsOf<{ base: string[]; variants: { variant: { primary: string; secondary: string; tertiary: string; ghost: string; destructive: string; }; size: { xs: string; sm: string; base: string; lg: string; }; rounded: { …; }; }; defaultVariants: { …; }; }> & ClassProp
Returns
string
Link()
Link(
props):Element
Parameters
props
Returns
Element
wrapTextChildren()
wrapTextChildren(
children):ReactNode[]
Parameters
children
ReactNode
Returns
ReactNode[]