Streamlit-Authenticator でログイン認証フォームを作る
Streamlit-Authenticator を使うと Streamlit で作成したアプリケーションへログインフォームや認証の機能を追加出来ます。 今回は Streamlit-Authenticator を使い、ログインフォーム機能を持った簡単なアプリケーションのサンプルを動作させるまでの手順をメモしておきます。
検証環境¶
対象 | バージョン |
---|---|
macOS | Sequoia 15.4.1 |
Python | 3.13.3 |
streamlit | 1.45.0 |
streamlit-authenticator | 0.4.2 |
ライブラリのインストール¶
Streamlit-Authenticator をインストールします。 Streamlit がインストールされていない場合、同時にインストールされます。
uv pip install streamlit-authenticator
今回は以下のパッケージ群がインストールされました。
% uv pip list
Package Version
-------------------------- -----------
altair 5.5.0
attrs 25.3.0
bcrypt 4.3.0
blinker 1.9.0
cachetools 5.5.2
captcha 0.7.1
certifi 2025.4.26
cffi 1.17.1
charset-normalizer 3.4.2
click 8.1.8
cryptography 44.0.3
extra-streamlit-components 0.1.80
gitdb 4.0.12
gitpython 3.1.44
idna 3.10
jinja2 3.1.6
jsonschema 4.23.0
jsonschema-specifications 2025.4.1
markupsafe 3.0.2
narwhals 1.38.0
numpy 2.2.5
packaging 24.2
pandas 2.2.3
pillow 11.2.1
protobuf 6.30.2
pyarrow 20.0.0
pycparser 2.22
pydeck 0.9.1
pyjwt 2.10.1
python-dateutil 2.9.0.post0
pytz 2025.2
pyyaml 6.0.2
referencing 0.36.2
requests 2.32.3
rpds-py 0.24.0
six 1.17.0
smmap 5.0.2
streamlit 1.45.0
streamlit-authenticator 0.4.2
tenacity 9.1.2
toml 0.10.2
tornado 6.4.2
typing-extensions 4.13.2
tzdata 2025.2
urllib3 2.4.0
Streamlit 用の設定ファイルを用意する¶
Streamlit を実行すると以下のように電子メールアドレスの入力を要求されます。
% streamlit run app.py
👋 Welcome to Streamlit!
If you’d like to receive helpful onboarding emails, news, offers, promotions,
and the occasional swag, please enter your email address below. Otherwise,
leave this field blank.
Email:
これを避ける為に以下の内容で .streamlit/config.toml
というファイルを新規作成します。 これで電子メールアドレスの入力を要求されなくなります。
[server]
headless = true
尚、後の手順で import streamlit_authenticator
しているスクリプトを (Streamlit 経由では無く) 直接、CLI から実行すると以下の警告が表示されます。
1 2 3 4 5 |
|
これは以下のように config.toml
へ設定を追記しても警告表示を消すことが出来ませんでした…
[global]
showWarningOnDirectExecution = true
[server]
headless = true
[logger]
level = "error"
パスワードを生成するスクリプト¶
Streamlit-Authenticator 用のパスワードを生成するサンプルプログラムです。
サンプルスクリプト¶
create_password.py | |
---|---|
1 2 3 4 5 |
|
実行例¶
「password123
」をハッシュ化すると「$2b$12$PJX4qZdjbv66RVd2kSS7wusNu4V0ikk9/wfC4A51U0iA4gy4D50Ru
」という値になりました。
% python create_password.py "password123"
2025-05-08 07:11:40.395 WARNING streamlit.runtime.caching.cache_data_api: No runtime found, using MemoryCacheStorageManager
2025-05-08 07:11:40.413 WARNING streamlit.runtime.scriptrunner_utils.script_run_context: Thread 'MainThread': missing ScriptRunContext! This warning can be ignored when running in bare mode.
2025-05-08 07:11:40.414 WARNING streamlit.runtime.scriptrunner_utils.script_run_context: Thread 'MainThread': missing ScriptRunContext! This warning can be ignored when running in bare mode.
2025-05-08 07:11:40.415 WARNING streamlit.runtime.scriptrunner_utils.script_run_context: Thread 'MainThread': missing ScriptRunContext! This warning can be ignored when running in bare mode.
2025-05-08 07:11:40.415 WARNING streamlit.runtime.scriptrunner_utils.script_run_context: Thread 'MainThread': missing ScriptRunContext! This warning can be ignored when running in bare mode.
$2b$12$PJX4qZdjbv66RVd2kSS7wusNu4V0ikk9/wfC4A51U0iA4gy4D50Ru
設定ファイルを作成する¶
ハッシュ値を取得したパスワードも利用し、Streamlit-Authenticator で認証する為の設定ファイルを作成します。 ひとつ前の手順で生成したパスワードを指定しています。 今回はサンプルですので「異なるユーザで同じパスワード (のハッシュ値)」を指定しています。
cookie:
expiry_days: 90
key: some_key
name: some_cookie_name
credentials:
usernames:
sato:
email: sato@example.com
name: 佐藤 一郎
password: $2b$12$PJX4qZdjbv66RVd2kSS7wusNu4V0ikk9/wfC4A51U0iA4gy4D50Ru
yamada:
email: yamada@example.com
name: 山田 二郎
password: $2b$12$PJX4qZdjbv66RVd2kSS7wusNu4V0ikk9/wfC4A51U0iA4gy4D50Ru
ログインフォームを表示するサンプル¶
Streamlit-Authenticator でログインフォームを表示する Web アプリケーションのサンプルです。
サンプルコード¶
app.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
実行例¶
CLI から Streamlit でアプリケーションを実行します。 デフォルトでは TCP/8501 を Listen します。 Listen するポート番号を変更したい場合は streamlit run app.py --server.port 8080
のように実行します。
enbutsu@macmini example1 % streamlit run app.py
Collecting usage statistics. To deactivate, set browser.gatherUsageStats to false.
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://10.0.0.1:8501
External URL: http://192.2.0.1:8501
For better performance, install the Watchdog module:
$ xcode-select --install
$ pip install watchdog
Web ブラウザで http://localhost:8501
にアクセスすると以下のように表示されました。 config.yml
で指定したユーザ名とパスワードでログインしてみます。
ユーザ名 | パスワード |
---|---|
sato |
password123 |
yamada |
password123 |
ログイン出来ました!
参考¶
% streamlit run --help
Usage: streamlit run [OPTIONS] TARGET [ARGS]...
Run a Python script, piping stderr to Streamlit.
The script can be local or it can be an url. In the latter case, Streamlit
will download the script to a temporary file and runs this file.
Options:
--global.disableWidgetStateDuplicationWarning BOOLEAN
By default, Streamlit displays a warning
when a user sets both a widget default value
in the function defining the widget and a
widget value via the widget's key in
`st.session_state`.
If you'd like to turn off this warning, set
this to True. [env var: STREAMLIT_GLOBAL_DI
SABLE_WIDGET_STATE_DUPLICATION_WARNING]
--global.showWarningOnDirectExecution BOOLEAN
If True, will show a warning when you run a
Streamlit-enabled script via "python
my_script.py". [env var: STREAMLIT_GLOBAL_S
HOW_WARNING_ON_DIRECT_EXECUTION]
--global.developmentMode BOOLEAN
Are we in development mode.
This option defaults to True if and only if
Streamlit wasn't installed normally. [env
var: STREAMLIT_GLOBAL_DEVELOPMENT_MODE]
--global.e2eTest BOOLEAN Are we in an e2e (playwright) test? Set
automatically when our e2e tests are
running. [env var:
STREAMLIT_GLOBAL_E2E_TEST]
--global.unitTest BOOLEAN Are we in a unit test? [env var:
STREAMLIT_GLOBAL_UNIT_TEST]
--global.appTest BOOLEAN Are we in an app test? Set automatically
when the AppTest framework is running [env
var: STREAMLIT_GLOBAL_APP_TEST]
--global.suppressDeprecationWarnings BOOLEAN
Hide deprecation warnings in the streamlit
app. [env var: STREAMLIT_GLOBAL_SUPPRESS_DE
PRECATION_WARNINGS]
--global.minCachedMessageSize FLOAT
Only cache ForwardMsgs that are greater than
or equal to this minimum. [env var:
STREAMLIT_GLOBAL_MIN_CACHED_MESSAGE_SIZE]
--global.maxCachedMessageAge INTEGER
Expire cached ForwardMsgs whose age is
greater than this value. A message's age is
defined by how many times its script has
finished running since the message has been
accessed. [env var:
STREAMLIT_GLOBAL_MAX_CACHED_MESSAGE_AGE]
--logger.level TEXT Level of logging for Streamlit's internal
logger: "error", "warning", "info", or
"debug".
Default: "info" [env var:
STREAMLIT_LOGGER_LEVEL]
--logger.messageFormat TEXT String format for logging messages. If
logger.datetimeFormat is set, logger
messages will default to
`%(asctime)s.%(msecs)03d %(message)s`.
See Python's documentation for available
attributes: https://docs.python.org/3/librar
y/logging.html#formatter-objects
Default: "%(asctime)s %(message)s" [env
var: STREAMLIT_LOGGER_MESSAGE_FORMAT]
--logger.enableRich BOOLEAN Controls whether uncaught app exceptions are
logged via the rich library.
If True and if rich is installed, exception
tracebacks will be logged with syntax
highlighting and formatting. Rich tracebacks
are easier to read and show more code than
standard Python tracebacks.
If set to False, the default Python
traceback formatting will be used.
Defaults to True if rich is installed, False
otherwise. [env var:
STREAMLIT_LOGGER_ENABLE_RICH]
--client.showErrorDetails TEXT Controls whether uncaught app exceptions and
deprecation warnings are displayed in the
browser. This can be one of the following:
- "full" : In the browser, Streamlit
displays app deprecation
warnings and exceptions, including exception
types, exception messages,
and associated tracebacks. - "stacktrace" :
In the browser, Streamlit displays
exceptions, including
exception types, generic exception messages,
and associated tracebacks. Deprecation
warnings and full exception
messages will only print to the
console. - "type" : In the browser,
Streamlit displays exception types and
generic exception messages. Deprecation
warnings, full exception
messages, and associated tracebacks only
print to the console. - "none" : In
the browser, Streamlit displays generic
exception messages.
Deprecation warnings, full exception
messages, associated tracebacks, and
exception types will only
print to the console. - True : This
is deprecated. Streamlit displays "full"
error details. - False : This is
deprecated. Streamlit displays "stacktrace"
error details. [env var:
STREAMLIT_CLIENT_SHOW_ERROR_DETAILS]
--client.toolbarMode TEXT Change the visibility of items in the
toolbar, options menu, and settings dialog
(top right of the app).
Allowed values: - "auto" : Show the
developer options if the app is accessed
through localhost or through
Streamlit Community Cloud as a developer.
Hide them otherwise. - "developer" : Show
the developer options. - "viewer" : Hide
the developer options. - "minimal" : Show
only options set externally (e.g. through
Streamlit Community Cloud) or through
st.set_page_config. If there
are no options left, hide the menu. [env
var: STREAMLIT_CLIENT_TOOLBAR_MODE]
--client.showSidebarNavigation BOOLEAN
Controls whether to display the default
sidebar page navigation in a multi-page app.
This only applies when app's pages are
defined by the `pages/` directory. [env
var:
STREAMLIT_CLIENT_SHOW_SIDEBAR_NAVIGATION]
--runner.magicEnabled BOOLEAN Allows you to type a variable or string by
itself in a single line of Python code to
write it to the app. [env var:
STREAMLIT_RUNNER_MAGIC_ENABLED]
--runner.postScriptGC BOOLEAN Run the Python Garbage Collector after each
script execution. This can help avoid excess
memory use in Streamlit apps, but could
introduce delay in rerunning the app script
for high-memory-use applications. [env var:
STREAMLIT_RUNNER_POST_SCRIPT_GC]
--runner.fastReruns BOOLEAN Handle script rerun requests immediately,
rather than waiting for script execution to
reach a yield point. This makes Streamlit
much more responsive to user interaction,
but it can lead to race conditions in apps
that mutate session_state data outside of
explicit session_state assignment
statements. [env var:
STREAMLIT_RUNNER_FAST_RERUNS]
--runner.enforceSerializableSessionState BOOLEAN
Raise an exception after adding
unserializable data to Session State. Some
execution environments may require
serializing all data in Session State, so it
may be useful to detect incompatibility
during development, or when the execution
environment will stop supporting it in the
future. [env var: STREAMLIT_RUNNER_ENFORCE_
SERIALIZABLE_SESSION_STATE]
--runner.enumCoercion TEXT Adjust how certain 'options' widgets like
radio, selectbox, and multiselect coerce
Enum members when the Enum class gets re-
defined during a script re-run. For more
information, check out the docs: https://doc
s.streamlit.io/develop/concepts/design/custo
m-classes#enums
Allowed values: - "off": Disables Enum
coercion. - "nameOnly": Enum classes can be
coerced if their member names match. -
"nameAndValue": Enum classes can be coerced
if their member names AND member values
match. [env var:
STREAMLIT_RUNNER_ENUM_COERCION]
--server.folderWatchBlacklist TEXT
List of folders that should not be watched
for changes.
Relative paths will be taken as relative to
the current working directory.
Example: ['/home/user1/env',
'relative/path/to/folder'] [env var:
STREAMLIT_SERVER_FOLDER_WATCH_BLACKLIST]
--server.fileWatcherType TEXT Change the type of file watcher used by
Streamlit, or turn it off completely.
Allowed values: - "auto" : Streamlit
will attempt to use the watchdog module, and
falls back to polling if watchdog is not
available. - "watchdog" : Force Streamlit to
use the watchdog module. - "poll" :
Force Streamlit to always use polling. -
"none" : Streamlit will not watch files.
[env var:
STREAMLIT_SERVER_FILE_WATCHER_TYPE]
--server.headless BOOLEAN If false, will attempt to open a browser
window on start.
Default: false unless (1) we are on a Linux
box where DISPLAY is unset, or (2) we are
running in the Streamlit Atom plugin. [env
var: STREAMLIT_SERVER_HEADLESS]
--server.runOnSave BOOLEAN Automatically rerun script when the file is
modified on disk. [env var:
STREAMLIT_SERVER_RUN_ON_SAVE]
--server.allowRunOnSave BOOLEAN
Allows users to automatically rerun when app
is updated. [env var:
STREAMLIT_SERVER_ALLOW_RUN_ON_SAVE]
--server.address TEXT The address where the server will listen for
client and browser connections. Use this if
you want to bind the server to a specific
address. If set, the server will only be
accessible from this address, and not from
any aliases (like localhost).
Default: (unset) [env var:
STREAMLIT_SERVER_ADDRESS]
--server.port INTEGER The port where the server will listen for
browser connections.
Don't use port 3000 which is reserved for
internal development. [env var:
STREAMLIT_SERVER_PORT]
--server.scriptHealthCheckEnabled BOOLEAN
Flag for enabling the script health check
endpoint. It's used for checking if a script
loads successfully. On success, the endpoint
will return a 200 HTTP status code. On
failure, the endpoint will return a 503 HTTP
status code.
Note: This is an experimental Streamlit
internal API. The API is subject to change
anytime so this should be used at your own
risk [env var: STREAMLIT_SERVER_SCRIPT_HEAL
TH_CHECK_ENABLED]
--server.baseUrlPath TEXT The base path for the URL where Streamlit
should be served from. [env var:
STREAMLIT_SERVER_BASE_URL_PATH]
--server.enableCORS BOOLEAN Enables support for Cross-Origin Resource
Sharing (CORS) protection, for added
security.
If XSRF protection is enabled and CORS
protection is disabled at the same time,
Streamlit will enable them both instead.
[env var: STREAMLIT_SERVER_ENABLE_CORS]
--server.enableXsrfProtection BOOLEAN
Enables support for Cross-Site Request
Forgery (XSRF) protection, for added
security.
If XSRF protection is enabled and CORS
protection is disabled at the same time,
Streamlit will enable them both instead.
[env var:
STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION]
--server.maxUploadSize INTEGER Max size, in megabytes, for files uploaded
with the file_uploader. [env var:
STREAMLIT_SERVER_MAX_UPLOAD_SIZE]
--server.maxMessageSize INTEGER
Max size, in megabytes, of messages that can
be sent via the WebSocket connection. [env
var: STREAMLIT_SERVER_MAX_MESSAGE_SIZE]
--server.enableArrowTruncation BOOLEAN
Enable automatically truncating all data
structures that get serialized into Arrow
(e.g. DataFrames) to ensure that the size is
under `server.maxMessageSize`. [env var:
STREAMLIT_SERVER_ENABLE_ARROW_TRUNCATION]
--server.enableWebsocketCompression BOOLEAN
Enables support for websocket compression.
[env var: STREAMLIT_SERVER_ENABLE_WEBSOCKET_
COMPRESSION]
--server.enableStaticServing BOOLEAN
Enable serving files from a `static`
directory in the running app's directory.
[env var:
STREAMLIT_SERVER_ENABLE_STATIC_SERVING]
--server.disconnectedSessionTTL INTEGER
TTL in seconds for sessions whose websockets
have been disconnected. The server may
choose to clean up session state, uploaded
files, etc for a given session with no
active websocket connection at any point
after this time has passed. [env var:
STREAMLIT_SERVER_DISCONNECTED_SESSION_TTL]
--browser.serverAddress TEXT Internet address where users should point
their browsers in order to connect to the
app. Can be IP address or DNS name and path.
This is used to: - Set the correct URL for
CORS and XSRF protection purposes. - Show
the URL on the terminal - Open the browser
[env var: STREAMLIT_BROWSER_SERVER_ADDRESS]
--browser.gatherUsageStats BOOLEAN
Whether to send usage statistics to
Streamlit. [env var:
STREAMLIT_BROWSER_GATHER_USAGE_STATS]
--browser.serverPort INTEGER Port where users should point their browsers
in order to connect to the app.
This is used to: - Set the correct URL for
XSRF protection purposes. - Show the URL on
the terminal (part of `streamlit run`). -
Open the browser automatically (part of
`streamlit run`).
This option is for advanced use cases. To
change the port of your app, use
`server.Port` instead. Don't use port 3000
which is reserved for internal development.
Default: whatever value is set in
server.port. [env var:
STREAMLIT_BROWSER_SERVER_PORT]
--server.sslCertFile TEXT Server certificate file for connecting via
HTTPS. Must be set at the same time as
"server.sslKeyFile".
['DO NOT USE THIS OPTION IN A PRODUCTION
ENVIRONMENT. It has not gone through
security audits or performance tests. For
the production environment, we recommend
performing SSL termination by the load
balancer or the reverse proxy.'] [env var:
STREAMLIT_SERVER_SSL_CERT_FILE]
--server.sslKeyFile TEXT Cryptographic key file for connecting via
HTTPS. Must be set at the same time as
"server.sslCertFile".
['DO NOT USE THIS OPTION IN A PRODUCTION
ENVIRONMENT. It has not gone through
security audits or performance tests. For
the production environment, we recommend
performing SSL termination by the load
balancer or the reverse proxy.'] [env var:
STREAMLIT_SERVER_SSL_KEY_FILE]
--ui.hideTopBar BOOLEAN Flag to hide most of the UI elements found
at the top of a Streamlit app.
NOTE: This does *not* hide the main menu in
the top-right of an app. [env var:
STREAMLIT_UI_HIDE_TOP_BAR]
--magic.displayRootDocString BOOLEAN
Streamlit's "magic" parser typically skips
strings that appear to be docstrings. When
this flag is set to True, Streamlit will
instead display the root-level docstring in
the app, just like any other magic string.
This is useful for things like notebooks.
[env var:
STREAMLIT_MAGIC_DISPLAY_ROOT_DOC_STRING]
--magic.displayLastExprIfNoSemicolon BOOLEAN
Make Streamlit's "magic" parser always
display the last expression in the root file
if it has no semicolon at the end. This
matches the behavior of Jupyter notebooks,
for example. [env var: STREAMLIT_MAGIC_DISP
LAY_LAST_EXPR_IF_NO_SEMICOLON]
--theme.base TEXT The preset Streamlit theme that your custom
theme inherits from. This can be one of the
following: "light" or "dark". [env var:
STREAMLIT_THEME_BASE]
--theme.primaryColor TEXT Primary accent color. [env var:
STREAMLIT_THEME_PRIMARY_COLOR]
--theme.sidebar.primaryColor TEXT
Primary accent color. [env var:
STREAMLIT_THEME_SIDEBAR_PRIMARY_COLOR]
--theme.backgroundColor TEXT Background color of the app. [env var:
STREAMLIT_THEME_BACKGROUND_COLOR]
--theme.sidebar.backgroundColor TEXT
Background color of the app. [env var:
STREAMLIT_THEME_SIDEBAR_BACKGROUND_COLOR]
--theme.secondaryBackgroundColor TEXT
Background color used for most interactive
widgets. [env var:
STREAMLIT_THEME_SECONDARY_BACKGROUND_COLOR]
--theme.sidebar.secondaryBackgroundColor TEXT
Background color used for most interactive
widgets. [env var: STREAMLIT_THEME_SIDEBAR_
SECONDARY_BACKGROUND_COLOR]
--theme.textColor TEXT Color used for almost all text. [env var:
STREAMLIT_THEME_TEXT_COLOR]
--theme.sidebar.textColor TEXT Color used for almost all text. [env var:
STREAMLIT_THEME_SIDEBAR_TEXT_COLOR]
--theme.linkColor TEXT Color used for all links. [env var:
STREAMLIT_THEME_LINK_COLOR]
--theme.sidebar.linkColor TEXT Color used for all links. [env var:
STREAMLIT_THEME_SIDEBAR_LINK_COLOR]
--theme.codeBackgroundColor TEXT
Background color used for code blocks. [env
var: STREAMLIT_THEME_CODE_BACKGROUND_COLOR]
--theme.sidebar.codeBackgroundColor TEXT
Background color used for code blocks. [env
var: STREAMLIT_THEME_SIDEBAR_CODE_BACKGROUND
_COLOR]
--theme.font TEXT The font family for all text, except code
blocks. This can be one of the following: -
"sans-serif" - "serif" - "monospace" - the
`font` value for a custom font table under
[[theme.fontFaces]] - a comma-separated list
of these (as a single string) to specify
fallbacks For example, you can use the
following: font = "cool-font, fallback-cool-
font, sans-serif" [env var:
STREAMLIT_THEME_FONT]
--theme.sidebar.font TEXT The font family for all text, except code
blocks. This can be one of the following: -
"sans-serif" - "serif" - "monospace" - the
`font` value for a custom font table under
[[theme.fontFaces]] - a comma-separated list
of these (as a single string) to specify
fallbacks For example, you can use the
following: font = "cool-font, fallback-cool-
font, sans-serif" [env var:
STREAMLIT_THEME_SIDEBAR_FONT]
--theme.codeFont TEXT The font family to use for code (monospace)
in the sidebar. This can be one of the
following: - "sans-serif" - "serif" -
"monospace" - the `font` value for a custom
font table under [[theme.fontFaces]] - a
comma-separated list of these (as a single
string) to specify fallbacks [env var:
STREAMLIT_THEME_CODE_FONT]
--theme.sidebar.codeFont TEXT The font family to use for code (monospace)
in the sidebar. This can be one of the
following: - "sans-serif" - "serif" -
"monospace" - the `font` value for a custom
font table under [[theme.fontFaces]] - a
comma-separated list of these (as a single
string) to specify fallbacks [env var:
STREAMLIT_THEME_SIDEBAR_CODE_FONT]
--theme.headingFont TEXT The font family to use for headings. This
can be one of the following: - "sans-serif"
- "serif" - "monospace" - the `font` value
for a custom font table under
[[theme.fontFaces]] - a comma-separated list
of these (as a single string) to specify
fallbacks If no heading font is set,
Streamlit uses `theme.font` for headings.
[env var: STREAMLIT_THEME_HEADING_FONT]
--theme.sidebar.headingFont TEXT
The font family to use for headings. This
can be one of the following: - "sans-serif"
- "serif" - "monospace" - the `font` value
for a custom font table under
[[theme.fontFaces]] - a comma-separated list
of these (as a single string) to specify
fallbacks If no heading font is set,
Streamlit uses `theme.font` for headings.
[env var:
STREAMLIT_THEME_SIDEBAR_HEADING_FONT]
--theme.fontFaces TEXT An array of fonts to use in your app. Each
font in the array is a table (dictionary)
with the following three attributes: font,
url, weight, and style. To host a font with
your app, enable static file serving with
`server.enableStaticServing=true`. You can
define multiple [[theme.fontFaces]] tables.
For example, each font is defined in a
[[theme.fontFaces]] table as follows:
[[theme.fontFaces]] font = "font_name" url =
"app/static/font_file.woff" weight = 400
style = "normal" [env var:
STREAMLIT_THEME_FONT_FACES]
--theme.baseRadius TEXT The radius used as basis for the corners of
most UI elements. This can be one of the
following: "none", "small", "medium",
"large", "full", or the number in pixels or
rem. For example, you can use "10px",
"0.5rem", or "2rem". To follow best
practices, use rem instead of pixels when
specifying a numeric size. [env var:
STREAMLIT_THEME_BASE_RADIUS]
--theme.sidebar.baseRadius TEXT
The radius used as basis for the corners of
most UI elements. This can be one of the
following: "none", "small", "medium",
"large", "full", or the number in pixels or
rem. For example, you can use "10px",
"0.5rem", or "2rem". To follow best
practices, use rem instead of pixels when
specifying a numeric size. [env var:
STREAMLIT_THEME_SIDEBAR_BASE_RADIUS]
--theme.borderColor TEXT The color of the border around elements.
[env var: STREAMLIT_THEME_BORDER_COLOR]
--theme.sidebar.borderColor TEXT
The color of the border around elements.
[env var:
STREAMLIT_THEME_SIDEBAR_BORDER_COLOR]
--theme.showWidgetBorder BOOLEAN
Whether to show a border around input
widgets. [env var:
STREAMLIT_THEME_SHOW_WIDGET_BORDER]
--theme.sidebar.showWidgetBorder BOOLEAN
Whether to show a border around input
widgets. [env var:
STREAMLIT_THEME_SIDEBAR_SHOW_WIDGET_BORDER]
--theme.baseFontSize INTEGER Sets the root font size (in pixels) for the
app, which determines the overall scale of
text and UI elements. The default base font
size is 16. [env var:
STREAMLIT_THEME_BASE_FONT_SIZE]
--theme.showSidebarBorder BOOLEAN
Whether to show a vertical separator between
the sidebar and the main content area. [env
var: STREAMLIT_THEME_SHOW_SIDEBAR_BORDER]
--secrets.files TEXT List of locations where secrets are
searched. An entry can be a path to a TOML
file or directory path where Kubernetes
style secrets are saved. Order is important,
import is first to last, so secrets in later
files will take precedence over earlier
ones. [env var: STREAMLIT_SECRETS_FILES]
--help Show this message and exit.