Pen-based user interface (Pen UI) is a primary style in the post-WIMP world and is commonly used in the ubiquitous computing environments. However, most current Pen UI technologies do not support a high-level, visual, multi-disciplinary authoring process. Moreover, concepts of reuse are rarely provided. A component-based approach is introduced with CoPenML architecture. The approach is entirely based on declarative XML documents, describing the component configuration and composition of Pen UI, as well as backend application logic. Another advantage of the approach is that component reuse is provided at both the system implementation level and the higher scene graph level. The overall architecture and XML-based implementation are described, especially the markup language specification for the UI profile documents. Finally, the associated authoring environment and tools involved are outlined, which shows the approach is practical and effective.