# How shall make logon ui better?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%3E%5C
**Category:** Beginners\
**Created:** [October 31, 2024, 4:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808 "2024-10-31T04:23:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![AI-Trader](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ai-trader/32/33721_2.png) [@AI-Trader](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAI-Trader)%5C
**Post date:** [October 31, 2024, 4:23am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F1 "2024-10-31T04:23:13Z")

</div>

my code looks like as below:

```auto
        with gr.Column(scale=1) as login_interface:
            # 登录部分
            username = gr.Textbox(label="Username")
            password = gr.Textbox(label="Password")
            login_btn = gr.Button("Login", variant='primary')

```

it looks not good which means their width is too big; and I want to make it looks like as below fig:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/5/a/5a0096bb2be2849353141cda0dd3c2ce9c9cff00.png)  
how shall I do that?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [October 31, 2024, 4:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F2 "2024-10-31T04:36:02Z")

</div>

Would it be something like this?

```py
with gr.Column(scale=1) as login_interface:
            # 登录部分
            with gr.Group():
                    gr.Markdown("### Login")
                    username = gr.Textbox(label="Username")
                    password = gr.Textbox(label="Password", type="password")
                    login_btn = gr.Button("Login", variant='primary')

```

or

```py
with gr.Column(scale=1) as login_interface:
            # 登录部分
            with gr.Group():
                    gr.Markdown("### Login")
                    with gr.Row():
                        username = gr.Textbox(label="Username")
                        password = gr.Textbox(label="Password", type="password")
                    login_btn = gr.Button("Login", variant='primary')

```

About type=“password”:

> **[Gradio Docs](https://www.gradio.app/docs/gradio/textbox)**
>
> Gradio docs for using

---

<div class="post-metadata">

**Author:** ![AI-Trader](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ai-trader/32/33721_2.png) [@AI-Trader](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAI-Trader)%5C
**Post date:** [October 31, 2024, 4:52am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F3 "2024-10-31T04:52:35Z")

</div>

thank you for your reply, but it still looks to wide as below:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/7/4/7486da211683b6de931ee423cbdeb299ff912e21.png)

---

<div class="post-metadata">

**Author:** ![AI-Trader](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ai-trader/32/33721_2.png) [@AI-Trader](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAI-Trader)%5C
**Post date:** [October 31, 2024, 4:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F4 "2024-10-31T04:53:54Z")

</div>

I just want to it looks not too wide as below:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/c/5/c50f86d1b960bf5b6ed9f21af8fe504793a089e1.png)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [October 31, 2024, 5:09am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F5 "2024-10-31T05:09:12Z")

</div>

Like this?

```py
import gradio as gr

CSS = """
.loginform {width=50%; align-items:center; !important;}
"""
with gr.Blocks(css=CSS) as demo:
    with gr.Column(scale=1) as login_interface:
            # 登录部分
            with gr.Group(elem_classes="loginform"):
                gr.Markdown("### Login")
                username = gr.Textbox(label="Username")
                password = gr.Textbox(label="Password", type="password")
                login_btn = gr.Button("Login", variant='primary')

demo.launch()

```

---

<div class="post-metadata">

**Author:** ![AI-Trader](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ai-trader/32/33721_2.png) [@AI-Trader](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAI-Trader)%5C
**Post date:** [October 31, 2024, 5:25am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F6 "2024-10-31T05:25:23Z")

</div>

thank you; it is most what I want except one point:

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/2/2/22b90d6f219b726d72e8828f3ed968ae0d81d82c.png)

there is much `gray` around the `login` ui, so shall I make the `gray` to `white` or delete the `gray`?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [October 31, 2024, 5:29am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F7 "2024-10-31T05:29:03Z")

</div>

I don’t know where this gray is coming from, so there’s no way to specify. I’ll check it out from Chrome in a bit.

---

<div class="post-metadata">

**Author:** ![AI-Trader](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ai-trader/32/33721_2.png) [@AI-Trader](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAI-Trader)%5C
**Post date:** [October 31, 2024, 5:33am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F8 "2024-10-31T05:33:37Z")

</div>

ok, thanks your help.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [October 31, 2024, 6:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-shall-make-logon-ui-better%2F114808%2F9 "2024-10-31T06:20:43Z")

</div>

I did.

```py
CSS = """
.loginform {width=50%; align-items:center; background-color:transparent; !important;}
"""

```
