Answers for "styled components default theme typescript"

1

styled components default theme typescript

// import original module declarations
import 'styled-components';

// and extend them!
declare module 'styled-components' {
  export interface DefaultTheme {
    borderRadius: string;

    colors: {
      main: string;
      secondary: string;
    };
  }
}
Posted by: Guest on February-05-2021
3

styled components props typescript

interface YourProps {
  invalid: boolean
}

const Input = styled.input`
  border: ${(p: YourProps) => p.invalid ? 'red' : 'blue'};
`
Posted by: Guest on December-04-2020

Code answers related to "styled components default theme typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language