🎨
Valence
🎨
Valence
  • Overview
    • 👋Welcome to Valence
    • 🏄‍♂️Getting started
  • Core Concepts
    • Responsiveness
    • Color
      • List of colors
      • Color types
    • Polymorphism
  • Valence Core
    • 🏃‍♂️Fundamentals
      • 🎬The ValenceProvider
      • ✍️Using custom fonts
    • 🧱Components
      • 🔘Buttons
        • Button with icon
        • Grid Button
        • Text button
        • Icon button
        • Multi-part button
        • Unstyled button
        • Primitive button
      • ⌨️Inputs
        • Color Picker
        • Text input
        • Text area
        • Number input
        • Select input
        • Switch
        • Slider
        • Range slider
        • Pill selector
        • Input container
        • Dropdown container
      • 🖥️Display
        • Accordion
        • Alert
        • Color Swatch
        • Icon
        • Image
        • Avatar
        • Avatar Group
        • Loader
        • Pill
        • Spoiler
        • Stepper
        • Text
        • Title
      • 🧩Layout
        • App Container
        • Card
        • Flex
          • Flex Center
          • Styled Flex
        • Floating Toolbar
        • Grid
        • Header
        • Overflow Container
        • Space
      • 🗺️Navigation
        • App Nav
      • 🔼Overlays
        • Modal
        • Tooltip
        • Modal background
        • 📰Sheets
          • Bottom Sheet
          • Dynamic Sheet
          • Side Sheet
    • 🪝Hooks
      • UseColorScheme
      • UseColors
      • UseControlledList
      • UseDetectKeyDown
      • UseDisclosure
      • UseFloating
      • UseTooltip
      • UseBreakpoint
      • UseResponsiveProps
    • 🤚Generics
      • Generic button props
      • Generic input props
      • Generic Sheet Props
  • Valence Plugins
    • 🎠Valence Carousel
      • Carousel Child Props
  • Valence Utils
    • ✋Generics
      • Clickable
      • Events
      • Global
      • Grid
      • Layout
      • Overlay
      • Polymorphic
    • 🧜‍♀️Polymorphism
      • Polymorphic Button
      • Polymorphic Layout
      • Polymorphic Text
  • Update Notes
    • 3.0.0
    • 2.7.0
    • 2.6.0
    • 2.5.0
    • 2.4.0
    • 2.3.0
    • 2.2.0
    • 2.1.0
    • 2.0.0
Powered by GitBook
On this page
  • Usage
  • Adding a right icon
  • Modifying the title or subtitle
  • Props
  • Changelog

Was this helpful?

Edit on GitHub
  1. Valence Core
  2. Components
  3. Buttons

Multi-part button

Last updated: 3.0.0 (04/07/2024)

A button used to display complex actions. Does not directly accept the children prop, instead taking the title and subtitle props to display text content.

Usage

import { MultipartButton } from "@valence-ui/core";
import { IconPlus } from "@tabler/icons-react";

function MyComponent() { 
    return ( 
        <MultipartButton
             title="This is a multi-part button!"
             subtitle="Isn't that cool?"
             leftIcon={<IconPlus />}
        />
    )
}

Adding a right icon

import { MultipartButton } from "@valence-ui/core";
import { IconPlus, IconChevronRight } from "@tabler/icons-react";

function MyComponent() { 
    return ( 
        <MultipartButton
             title="This is a multi-part button!"
             subtitle="Isn't that cool?"
             leftIcon={<IconPlus />}
             rightIcon={<IconChevronRight />}
        />
    )
}

Modifying the title or subtitle

titleProps and subtitleProps can be passed into the button to modify the appearance of the title and subtitle. Both under the hood use the Text component with some pre-configured styling.

import { MultipartButton } from "@valence-ui/core";

function MyComponent() { 
    return ( 
        <MultipartButton
             title="This is a multi-part button!"
             subtitle="Isn't that cool?"
             titleProps={{
                  size: "xl"
                  color: "blue"
             }}
             subtitleProps={{
                  size: "xs"
                  color: "black"
             }}
        />
    )
}

Props

Property
Type
Description

title (required)

string

Title/main text content of this button.

subtitle

string

Descriptive secondary text of this button.

leftIcon

ReactNode

Icon to display on the left of the button.

rightIcon

ReactNode

Icon to display on the right of the button.

iconContainerStyle

CSSProperties

Styles to pass to the icon containers.

titleProps

TextProps

Props to pass to the title text component.

subtitleProps

TextProps

Props to pass to the subtitle text component.


Changelog

  • 3.0.0: added the iconContainerStyle prop; now uses padding prop.

  • 2.1.0: the leftIcon and rightIcon props can support multiple sub-components.

PreviousIcon buttonNextUnstyled button

Last updated 11 months ago

Was this helpful?

Extends .

🧱
🔘
PrimitiveButtonProps