Answers for "styled-components documentation"

4

styled componets npm

npm i styled-components
Posted by: Guest on August-14-2020
2

how to create styled components

import styled from 'styled-component';

// Create a Title component that'll render an <h1> tag with some styles
const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

// Create a Wrapper component that'll render a <section> tag with some styles
const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip;
`;

// Use Title and Wrapper like any other React component – except they're styled!
render(
  <Wrapper>
    <Title>
      Hello World!
    </Title>
  </Wrapper>
);
Posted by: Guest on July-28-2021
0

styled componennts

npm install --save styled-componentsnpm install --save styled-components
Posted by: Guest on September-05-2021

Browse Popular Code Answers by Language