Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
Storybook web component code examples extra comment tags

We are trying to create a design guideline with lit and want to use storybook to document our components. Here is a example story (in mdx format) that I use:

import { html } from 'lit';
import { Canvas, Story } from '@storybook/addon-docs';
import './gr-button';

export const Template = (args) => html`<gr-button 
    ?secondary=${args.variant === 'secondary'} 
    ?disabled=${args.disabled} 
    ?block=${args.block} 
    ?medium=${args.size === 'medium'} 
    ?small=${args.size === 'small'}>${args.label}</gr-button>`;

<Canvas columns={1}>
  <Story name="Secondary Block disabled button"  args={{ disabled: true, variant: 'secondary', block: true, label: 'Fill the form' }}>
    {Template.bind({})}
  </Story>
</Canvas>

And here the result that Storybook shows in "Show code" panel in the UI:

<gr-button secondary="" disabled="" block=""><!--?lit$754556085$-->Fill the form</gr-button>

Anyone know how to get rid of empty values for boolean attributes and that lit comment tag?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!