Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@synerise/ds-button

Package Overview
Dependencies
Maintainers
0
Versions
235
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synerise/ds-button

Button UI Component for the Synerise Design System

  • 0.21.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by140.66%
Maintainers
0
Weekly downloads
 
Created
Source
import { version } from './package.json';
`Current version: ${version}`;
@synerise/ds-button https://www.npmjs.com/package/@synerise/ds-button

Storybook

Buttons allow users to take actions, and make choices, with a single tap. Buttons communicate actions that users can take. They are typically placed throughout your UI, in places such as dialogs, modal windows, forms, cards, and toolbars.

Inspired by Ant Design Button

When to use it

  • To produce things that didn’t exist before (register, submit, save, and more).
  • To perform actions (send, delete, edit, cancel, and more).
  • To confirm the displayed information.
  • Generally, to be used when actions caused by users affect back-end and/or front-end of the application.

Component anatomy

This is a simple component, which means that it doesn't consist of other components.

Installation

npm i @synerise/ds-button

or

yarn add @synerise/ds-button

Usage

import Icon from '@synerise/ds-icon';
import { AngleDownS } from '@synerise/ds-icon';
<div>
    <Button mode="split" type="custom-color" color="green">
        Click
        <Icon component={<AngleDownS />} />
    </Button>
</div>

Button

PropertyDescriptionTypeDefault
colorDefines color of custom-color button.green / grey / yellow / blue / pink/ mars/ orange/ fern/ cyan/ purple / violetred
disabledDefines if the button is disabled.booleanfalse
groupVariantDefines shape of the buttonleft-rounded / squared / right-rounded-
justifyContentDefines justify of content in button.JustifyContentProperty (React.CSSPRroperties)-
loadingSets the loading status of button.boolean / { delay?: number }false
modeDefines the mode of the button content. It affects content inside the buttonsingle-icon / split / two-icons /label-icon / icon-label-
onClickCallback executed after clicking the button(event: React.MouseEvent) => void-
typeDefines the type of the button.primary / secondary/ tertiary/ tertiary-white / ghost-primary / ghost / ghost-white / custom-color / custom-color-ghostsecondary
iconColorDefines color of icon in button.green / grey / yellow / blue / pink/ mars/ orange/ fern/ cyan/ purple / violetgrey
errorDefines if the button has error button styles .booleanfalse
activatedDefines if the button has activated button styles .booleanfalse

Button.Creator

PropertyDescriptionTypeDefault
blockDefines if the button should take all available space.booleanfalse
disabledDefines if the button is disabled.booleanfalse
labelLabel of the button.string / React.ReactNode-
onClickCallback executed after clicking the button(event: React.MouseEvent) => void-
statusDefines the color of the button.upload / error/ defaultdefault

Button.Expander

PropertyDescriptionTypeDefault
disabledDefines if the button is disabled.booleanfalse
expandedThe current state of the button.booleanfalse
onClickCallback executed after clicking the button(event: React.MouseEvent) => void-
sizeDefines the size of the button.S / MM

Button.Checkbox

This is special checkbox built on Button and inheriting its appereance. It behaves like checkbox input due to role="checkbox" and aria-checked attributes.

Props

It inherits all Button's props excluding type, block, color, groupVariant, icon, iconColor, leftIconSize, mode, rightIconSize, size, onChange.

PropertyDescriptionTypeDefault
checked(optional) Sets checkbox state for controlled component.booleanundefined
defaultChecked(optional) Sets checkbox state for uncontrolled component.booleanfalse
hasError(optional) Changes appereance for wrong validation.booleanundefined
indeterminate(optional) Forces indeterminate checkbox state.booleanundefined
onChange(optional) On change callback(checked: boolean) => void

Button.Star

This is star toggle built on Button and inheriting its appereance.

Props

It inherits all Button's props excluding.

PropertyDescriptionTypeDefault
active(optional) Sets checkbox state for controlled component.booleanundefined

FAQs

Package last updated on 17 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc