1.0.0-beta.1 • Published 1 year ago

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

Weekly downloads
-
License
LGPL-2.1-only
Repository
-
Last release
1 year 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

2 years ago

1.0.0-beta.21

1 year ago

1.0.0-beta.12

2 years ago

1.0.0-beta.19

2 years ago

1.0.0-beta.17

2 years ago

1.0.0-beta.18

2 years ago

1.0.0-beta.15

2 years ago

1.0.0-beta.16

2 years ago

1.0.0-beta.13

2 years ago

1.0.0-beta.14

2 years ago

1.0.0-beta.11

2 years ago

1.0.0-beta.10

2 years ago

1.0.0-beta.9

2 years ago

1.0.0-beta.6

2 years ago

1.0.0-beta.7

2 years ago

1.0.0-beta.8

2 years ago

1.0.0-beta.4

2 years ago

1.0.0-beta.5

2 years ago

1.0.0-beta.3

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.1

2 years ago

1.0.0

2 years ago