I have a labelname and its value within div tag and in another div tag, I have added a button. I want the labelname, its value and the button to be in the same line or row. below is my code typescript and react.
render = () => {
return (
<Wrapper>
<Count>
<SpanComponent>
Counter value
</LabelComponent>
<SpanComponent
color={
counter === 0
? 'red'
: counter === 1
? 'blue'
: 'green'
}
>
{' '}
{counter}
</SpanComponent>
</Count>
<ButtonWrapper>
<Button>
Button
</Button>
</ButtonWrapper>
</Wrapper>
)
}
const ButtonWrapper = styled.div`
display: flex;
justify-content: flex-end;
`;
const LabelComponent = styled.span<Props>`
margin: 0;
padding: 0;
line-height: ${props => props.lineh || 1.5};
text-align: ${props => props.align || 'initial'};
`;
With the above code, it looks like below,
Could someone help me put the labelname, value and the button in the same line... something like below,
Counter value 0 Button
Thanks.