1

I'm using the components from semantic-ui-react to display a Field and Button like below:

<Segment clearing>
    <Form>
        <Form.Group style={{ display: "flex" }}>
            <Form.Field style={{ flexGrow: "1" }}>
                <Form.Input
                    placeholder="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
                    focus
                />
            </Form.Field>

            <Form.Button
                    color="green"
                    floated="right"
                    content="Add new API key"
                    type='submit'
            />
        </Form.Group>
    </Form>
</Segment>  

Nothing incredibly fancy, the result is as below:

enter image description here

I want to reposition the placeholder in the Form.Input to the right side like below:

enter image description here

How exactly can I achieve this?

2 Answers 2

2
+50

I would use the CSS placeholder selector. You could, for example, give the Form.Input component an arbitrary class such as "input-aligned-end" and then style it in CSS:

.input-aligned-end::placeholder {
  text-align: end;
}
Sign up to request clarification or add additional context in comments.

Comments

0

Not sure but try this

labelPosition='right'

style

style={{
        paddingLeft: "50%"
   }}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.