scrimba
Styled Components
Polymorphic Prop
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Polymorphic Prop
Expand for more info
components
Content.js
run
preview
console
import React from 'react'
import styled from 'styled-components'
import Button from './Button'
import Icon from './Icon'

const Title = styled.h1`
color: #aaecf0;
`
const Section = styled.div`
background-color: #aac9f0;
display: flex;
justify-content: center;
flex-direction: column;
border-radius: 15px;
`

const SubTitle = styled(Title)`
font-size: 12px;
align-self: center;
`;

const ParagraphTitle = styled(SubTitle)`
color: grey;
`

const Content = () => {
return (
<Section>
<Title>💅🏻 Section</Title>
<SubTitle>I am a subtitle</SubTitle>
<Button text='me first' primary/>
<Button text='me second'/>
<Icon primary />
<Icon />
<ParagraphTitle>I am a paragraph title</ParagraphTitle>
</Section>
)
}

export default Content

//Mini Challenge
//Can you reverse the words in both buttons in a similar way we did with the
//Paragraph Title?
Console
/index.html
-4:59