-
Perhaps someone asked a question. I don’t quite understand how this design system can be used conveniently for React. Are there any ready-made implementation examples? |
Beta Was this translation helpful? Give feedback.
Answered by
asyncLiz
Nov 13, 2023
Replies: 1 comment 3 replies
-
Better React docs and helpers are on our todo list, but until then it takes a bit of setup. I'd recommend reading through https://lit.dev/docs/frameworks/react/ to start with. The tl;dr is to use import React from 'react';
import {createComponent} from '@lit/react';
import {MdFilledButton as MdFilledButtonWebComponent} from '@material/web/button/filled-button.js';
export const MdFilledButton = createComponent({
tagName: 'md-filled-button',
elementClass: MdFilledButtonWebComponent,
react: React,
}); import {MdFilledButton} from './wrappers/md-filled-button';
export function MyApp() {
return <MdFilledButton>Button</MdFilledButton>;
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
futornoi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better React docs and helpers are on our todo list, but until then it takes a bit of setup.
I'd recommend reading through https://lit.dev/docs/frameworks/react/ to start with. The tl;dr is to use
@lit-labs/react
to build wrapper React components, then use those.