Skip to content

Commit 60373b9

Browse files
authored
Merge pull request #790 from maiieul/docs-styled-kit-barrel-file
docs(styled install): add barrel file bonus step
2 parents fa8dd7a + 5ae7066 commit 60373b9

File tree

2 files changed

+31
-2
lines changed
  • apps/website/src/routes/docs/styled/(getting-started)/install
  • packages/kit-styled/src/components/checkbox

2 files changed

+31
-2
lines changed

apps/website/src/routes/docs/styled/(getting-started)/install/index.mdx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,32 @@ This might seem like a lot of configuration, but we believe it to be worth it be
230230
### Step 4: Find the components you need in the docs and copy/paste them into your project
231231

232232
You will find the components code in their corresponding link in the docs.
233+
234+
### Bonus step: add a barrel file to ~/components/ui
235+
236+
```tsx
237+
export * from './accordion/accordion';
238+
export * from './alert/alert';
239+
export * from './avatar/avatar';
240+
export * from './badge/badge';
241+
export * from './breadcrumb/breadcrumb';
242+
export * from './button/button';
243+
export * from './card/card';
244+
export * from './checkbox/checkbox';
245+
export * from './combobox/combobox';
246+
export * from './input/input';
247+
export * from './label/label';
248+
export * from './modal/modal';
249+
export * from './popover/popover';
250+
export * from './progress/progress';
251+
export * from './radio-group/radio-group';
252+
export * from './separator/separator';
253+
export * from './skeleton/skeleton';
254+
export * from './tabs/tabs';
255+
export * from './textarea/textarea';
256+
export * from './select/select';
257+
```
258+
259+
This way you can now `import { Accordion, Alert, ... } from '~/components/ui';` 👯‍♀️
260+
261+
(**small tip:** you can commment out the components you don't use!)

packages/kit-styled/src/components/checkbox/checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { $, PropsOf, component$ } from '@builder.io/qwik';
22
import { cn } from '@qwik-ui/utils';
33

4-
export const Checkbox = component$<PropsOf<'input'>>(
4+
export const Checkbox = component$<PropsOf<'input'> & { type?: 'checkbox' }>(
55
({ id, name, ['bind:checked']: checkedSig, checked, onInput$, ...props }) => {
66
const inputId = id || name;
77
return (
88
<input
9-
type="checkbox"
109
{...props}
10+
type="checkbox"
1111
// workaround to support two way data-binding on the Input component (https://github.com/QwikDev/qwik/issues/3926)
1212
checked={checkedSig ? checkedSig.value : checked}
1313
onInput$={checkedSig ? $((_, el) => (checkedSig.value = el.checked)) : onInput$}

0 commit comments

Comments
 (0)