Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

Align Office UI fabric button to right

(0) ShareShare
ReportReport
Posted on by 61

Hello,

I haven't worked with office UI or react but Somehow managed to create a button, but it's aligned to left, I need it to be right-aligned.

 
 
 

 

chevron.JPG

Below is the react code.

 

 render() {
 
 
 var emojiIcon: IIconProps = { iconName: 'DoubleChevronRight', };
 
 emojiIcon.style={float:'right',color:'#000000'};
 return (
 
 <IconButton iconProps={emojiIcon} title="Next" ariaLabel="Next"onClick={(e) => {
 this.props.onChange(true)
 
 }} />
 );
 }

 

 No CSS files used, Can someone advise, please?

Many Thanks.

Nijo

  • Verified answer
    Nijos Profile Picture
    61 on at
    Re: Align Office UI fabric button to right

    Hi Danz,

     

    Thank you for your input, I was getting the following error when trying to add align property to a div.

     

    (JSX attribute) align: string
    Type '{ children: Element; align: string; }' is not assignable to type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.
    Property 'align' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'.ts(2322)
     
    However, with few google searches on aligning a div gave me the solution.
     

     

    return (
     <div id="child" style={{ display: "flex", justifyContent: "flex-end" }}>
     <IconButton iconProps={emojiIcon} title="Next" ariaLabel="Next"onClick={(e) => {
     this.props.onChange(true)
     
     }} />
    
     </div>
    
     );

     

     

    Many Thanks again for the input.

    Nijo

  • Verified answer
    Danish N. Profile Picture
    186 on at
    Re: Align Office UI fabric button to right

    You can use div and wrap your IconButton and have div align contents right. Code snippet below.

     

    return (
     <div align="right">
     <IconButton iconProps={emojiIcon} title="Next" ariaLabel="Next"onClick={(e) => { this.props.onChange(true) }} />
     </div>
    );

     

    Hope that helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard