Skip to content

Commit 91c8da7

Browse files
fix: height bug & avatar ref
1 parent 3662b21 commit 91c8da7

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

pages/Avatar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import streamlit_shadcn_ui as ui
2+
3+
ui.avatar(src="https://imagedelivery.net/tSvh1MGEu9IgUanmf58srQ/e2b094c8-8519-4e8b-e92e-1cf8d4b58f00/public")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "streamlit-shadcn-ui"
7-
version = "0.1.9"
7+
version = "0.1.10"
88
readme = "README.md"
99
keywords = ["streamlit", "shadcn", "ui", "components"]
1010
description = "Using shadcn components in Streamlit"

streamlit_shadcn_ui/components/packages/frontend/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function App(props: ComponentProps<{comp: string; props: any; [key: string]: any
5858

5959
useEffect(() => {
6060
if (container.current) {
61-
Streamlit.setFrameHeight(container.current.offsetHeight + 5);
61+
Streamlit.setFrameHeight(container.current.offsetHeight + 10);
6262
}
6363
}, []);
6464

streamlit_shadcn_ui/components/packages/frontend/src/components/streamlit/alertDialog.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export const StAlertDialog = forwardRef<HTMLDivElement, StAlertDialogProps>(
3030
} = props;
3131
useEffect(() => {
3232
if (ref && typeof ref !== "function") {
33-
Streamlit.setFrameHeight(ref.current.offsetHeight + 5);
34-
// Streamlit.setFrameHeight(1000);
33+
Streamlit.setFrameHeight(ref.current.offsetHeight + 10);
3534
}
3635
});
3736
useBodyStyle(

streamlit_shadcn_ui/components/packages/frontend/src/components/streamlit/avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const StAvatar = forwardRef<HTMLDivElement, StAvatarProps>(
1010
const { src, fallback } = props;
1111

1212
return (
13-
<Avatar>
13+
<Avatar ref={ref}>
1414
<AvatarImage src={src} />
1515
<AvatarFallback>{fallback}</AvatarFallback>
1616
</Avatar>

streamlit_shadcn_ui/py_components/slider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .utils import declare_component
22

3-
_component_func = declare_component("slider")
3+
_RELEASE = True
4+
_component_func = declare_component("slider", release=_RELEASE)
45

56
def slider(default_value=None, min_value=0, max_value=100, step=1, label=None, key=None):
67
props = {

0 commit comments

Comments
 (0)