Skip to content

Commit

Permalink
docs(web-components): set attributes in example story
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Jul 8, 2021
1 parent e2d34ea commit 2c47a6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Meta, Story } from '@storybook/web-components';
import { html } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';

import { SbButton } from './sb-button';

Expand All @@ -20,9 +21,9 @@ export default {
const Template: Story<SbButton> = ({ primary, backgroundColor, size, label }) =>
html`<sb-button
?primary="${primary}"
.size="${size}"
.label="${label}"
.backgroundColor="${backgroundColor}"
size="${ifDefined(size)}"
label="${ifDefined(label)}"
background-color="${ifDefined(backgroundColor)}"
></sb-button>`;

export const Primary: Story<SbButton> = Template.bind({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class SbButton extends LitElement {
label: { type: String, reflect: true },
primary: { type: Boolean },
size: { type: String },
backgroundColor: { type: String },
backgroundColor: { type: String, attribute: 'background-color' },
};
}

Expand Down

0 comments on commit 2c47a6e

Please sign in to comment.