1.0.0-beta.1 • Published 12 months ago

@quartzds/open-core-react v1.0.0-beta.1

Weekly downloads
-
License
LGPL-2.1-only
Repository
-
Last release
12 months ago

@quartzds/open-core-react

NPM Package License

React wrapper for Quartz design system web components.

💿 Installation

npm install @quartzds/open-core-react react react-dom

📖 Usage

Importing Components

Every Quartz core component is available to import as a React component. Note that we're importing the <QdsButton> React component instead of the <qds-button> custom element in the example below:

import { QdsButton } from '@quartzds/open-core-react'

const MyComponent = () => (
  <QdsButton importance="emphasized">Click me</QdsButton>
)

export default MyComponent

Event Handling

Many Quartz core components emit custom events. For example, the input component emits the qdsInput event when it receives input. In React, you can listen to the event using onQdsInput.

Here's how you can bind the input's value to a state variable:

import { useState } from 'react'
import { QdsInput } from '@quartzds/open-core-react'

function MyComponent() {
  const [value, setValue] = useState('')

  return (
    <QdsInput
      value={value}
      onQdsInput={(event) => setValue(event.target.value)}
    />
  )
}

export default MyComponent

⚖️ License

See the LICENSE file for license rights and limitations.

1.0.0-beta.20

12 months ago

1.0.0-beta.21

12 months ago

1.0.0-beta.12

1 year ago

1.0.0-beta.19

1 year ago

1.0.0-beta.17

1 year ago

1.0.0-beta.18

1 year ago

1.0.0-beta.15

1 year ago

1.0.0-beta.16

1 year ago

1.0.0-beta.13

1 year ago

1.0.0-beta.14

1 year ago

1.0.0-beta.11

1 year ago

1.0.0-beta.10

1 year ago

1.0.0-beta.9

1 year ago

1.0.0-beta.6

1 year ago

1.0.0-beta.7

1 year ago

1.0.0-beta.8

1 year ago

1.0.0-beta.4

1 year ago

1.0.0-beta.5

1 year ago

1.0.0-beta.3

1 year ago

1.0.0-beta.2

2 years ago

1.0.0-beta.1

2 years ago

1.0.0

2 years ago