I have Card with 2 Card.Sections. I'm trying to align the second one to far right however nothing works for me. I tried:
Setting sections as flex
and assigning marginLeft: auto
for the second one
Setting Card position: relative
, then adding float: right
to the second one
I faced the same issue today, here's how I solved it:
<Card horizontal tokens={cardTokens}>
<Card.Section>
<Checkbox
label="todo status"
/>
</Card.Section>
<Card.Item grow={1}>
<span />
</Card.Item>
<Card.Section styles={footerCardSectionStyles}>
<Icon iconName="Delete" />
</Card.Section>
</Card>
As you can see I used
<Card.Item grow={1}>
<span />
</Card.Item>
between the two Card.Section
s this is inserting an element with the remaining width thus pushing the second Card.Section
to the end.