A widget (the type you're referring to) is simply an html page that, with the help of winterboard, basically acts as your homescreen wallpaper. Most widgets are wallpaper dependent, which means that they need some kind of background to float above. Most of the widget functions, such as date and time and weather, are coded with javascript. The formatting is handled through CSS. If you know anything about coding, you can easily make your own widget. You can find a lot of widgets floating around on Cydia (a decent one is WeatherFurik, although it's horribly coded/arranged and will most likely just confuse you when you try to customize it), but really the best place for widgets that I've found is dbarteam. They have a lot of very skilled coders/theme artists and produce some of the best widgets I've seen.