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

@zendeskgarden/react-buttons

Package Overview
Dependencies
Maintainers
0
Versions
274
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zendeskgarden/react-buttons

Components relating to buttons in the Garden Design System

  • 9.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by4.79%
Maintainers
0
Weekly downloads
 
Created
Source

@zendeskgarden/react-buttons npm version

This package includes components relating to buttons in the Garden Design System.

Installation

npm install @zendeskgarden/react-buttons

# Peer Dependencies - Also Required
npm install react react-dom styled-components @zendeskgarden/react-theming

Usage

Button

import { ThemeProvider } from '@zendeskgarden/react-theming';
import { Button } from '@zendeskgarden/react-buttons';

/**
 * Place a `ThemeProvider` at the root of your React application
 */
<ThemeProvider>
  <>
    <Button onClick={() => alert('clicked')}>Default</Button>
    <Button isPrimary isDanger>
      Primary danger button
    </Button>
  </>
</ThemeProvider>;

Media button

import React, { useState } from 'react';
import { Button } from '@zendeskgarden/react-buttons';
import StartIcon from '@zendeskgarden/icons/src/16/shield-stroke.svg';
import EndIcon from '@zendeskgarden/icons/src/16/chevron-down-stroke.svg';

const MediaButton = ({ children, ...props }) => {
  const [isRotated, setRotated] = useState(false);

  return (
    <Button onClick={() => setRotated(!isRotated)} {...props}>
      <Button.StartIcon>
        <StartIcon />
      </Button.StartIcon>
      {children}
      <Button.EndIcon isRotated={isRotated}>
        <EndIcon />
      </Button.EndIcon>
    </Button>
  );
};

Keywords

FAQs

Package last updated on 21 Nov 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